Skip to content

Commit

Permalink
Added functional test (tweedegolf#34)
Browse files Browse the repository at this point in the history
* Added functional test

* Show test output

* Random port numbers

* Fix formatting

* Use current ip

* Longer wait period for mailcrab to startup

* Increase timeout
  • Loading branch information
marlonbaeten authored Mar 16, 2023
1 parent 7240e44 commit dc35abe
Show file tree
Hide file tree
Showing 6 changed files with 285 additions and 77 deletions.
37 changes: 28 additions & 9 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,39 @@ jobs:
- uses: actions/checkout@v3
- run: rustup toolchain install stable --profile minimal
- run: rustup component add clippy
- uses: actions/cache@v3

- uses: actions/cache/restore@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
frontend/target/
key: frontend-${{ hashFiles('frontend/Cargo.toml') }}
restore-keys: frontend-

- uses: actions/cache/restore@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
backend/target/
key: check-${{ hashFiles('**/Cargo.toml') }}
restore-keys: check-
- run: cargo check --manifest-path backend/Cargo.toml
- run: cargo check --manifest-path frontend/Cargo.toml
- run: cargo clippy --manifest-path backend/Cargo.toml
- run: cargo clippy --manifest-path frontend/Cargo.toml
- run: cargo fmt --check --manifest-path backend/Cargo.toml
- run: cargo fmt --check --manifest-path frontend/Cargo.toml
key: backend-linux-x86-64-gnu-${{ hashFiles('backend/Cargo.toml') }}
restore-keys: backend-linux-x86-64-gnu-

- run: cargo check && cargo clippy && cargo fmt --check
working-directory: backend

- name: Functional test
run: cargo test -- --nocapture
shell: bash
env:
HTTP_PORT: 26814
SMTP_PORT: 33543
working-directory: backend

- run: cargo check && cargo clippy && cargo fmt --check
working-directory: frontend
153 changes: 149 additions & 4 deletions backend/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions backend/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mailcrab-backend"
version = "0.8.0"
version = "0.10.0"
edition = "2021"
publish = false

Expand All @@ -24,6 +24,7 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"] }
uuid = { version = "1.2", features = ["v4", "serde"] }

[dev-dependencies]
lettre = { version = "0.10", features=["smtp-transport", "builder"] }
lettre = { version = "0.10", default-features = false, features=["smtp-transport", "hostname", "builder"] }
fake = { version = "2.5", features=["derive"]}
rand = "0.8"
reqwest = { version = "0.11", features = ["json"] }
local-ip-address = "0.5"
Loading

0 comments on commit dc35abe

Please sign in to comment.