Skip to content

Commit

Permalink
feat: Ephemeral DB mode & CLI integration tests (#217)
Browse files Browse the repository at this point in the history
Main addition: Integration tests between the CLI and server in `fission-cli/tests/main.rs`.
Also:
- Add `--ephemeral-db` parameter to the server to use an ephemeral DB while running which is destroyed on close
- Add `--close-on-stdin-close` parameter to the server to enable listening on EOF in stdin and closing appropriately
- Add `--gen-key-if-needed` parameter to the server to enable writing a new key to the fs if there is none yet
- Added `--no-colors` CLI parameter to turn of colored output
- Added hidden `--key-seed` CLI parameter to enable isolating CLI tests
- Refactor server tests a bit. More `?` and less `&`, `TestContext::request` shorthand, etc.

---

* refactor: Add `test_utils` feature and expose stuff there

* refactor: Make tests a tiny bit nicer to work with

* chore: CLI <> Server integration test setup

* refactor: Extract out ephermeral DB code

* feat: Ephemeral DB setups/teardowns

* fix: Fix types by adding the test setup under `test_utils` feature

* chore: Write account creation test

* chore: Specify exact revision for rexpect

* refactor: Make `&str` sigs more flexible

* chore: Write another integration test & run tests serially

* chore: Write all integration tests

* chore: Re-enable coverage for CLI code

* chore: Explictily allow unreleased `rexpect`

* feat: Add `--gen-key-if-needed`server param

* feat: Allow running the CLI without a preexisting settings toml

* chore: Warn about missing settings file

* chore: Let cargo test capture server stdout/stderr 💄

* chore: Try not using `--close-on-stdio-close`

* chore: Remove unused `revisions` field

* chore: Fix coverate workflow by disabling doctests

rust-lang/rust#95825
is the underlying issue.

* chore: Add comment explaining the reason for disabling doctests
  • Loading branch information
matheus23 committed Jan 23, 2024
1 parent 829b356 commit 8985ae9
Show file tree
Hide file tree
Showing 29 changed files with 1,628 additions and 495 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ jobs:
LLVM_PROFILE_FILE: "fission-server-%p-%m.profraw"
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off'
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off'
run: cargo test --all-features
# Disable doctest compilation due to https://github.com/rust-lang/rust/issues/95825
run: cargo test --all-features --lib --tests

- name: Install grcov
run: "curl -L https://github.com/mozilla/grcov/releases/download/v0.8.12/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf -"
Expand Down
Loading

0 comments on commit 8985ae9

Please sign in to comment.