Skip to content

Commit

Permalink
CLI Demos (#354)
Browse files Browse the repository at this point in the history
* Update demos, bump dependency.

* Remove end demo include.

* Add failing test spec for server command.

Need to disable the networking for tests and demos.

* Prepare for offline mode.

* Write pending enrollment to disc.

Remove when enrollment finishes successfully.

* Add test spec for pending enrollment file.

* Add re-export for PendingEnrollment.

* Support offline argument for account creation.

* Move constructors out of trait.

Now that the network and local constructors have diverged to account for
the offline option it's better they are not defined in the trait.

* Tweak server boot output.

Avoid using tracing for startup messages.

* Prepare for folders demo.

* Tidy success message handling.

* Move shell specs to individual files.

* Improve folders demo.

* Sort folders list, accept comments in shell.

* Invert sort order.

* Update shell demo.

* Add quit to shell demo.

* Add security-report and audit specs/demos.

Improve handling of SOS_OFFLINE.

* Fix RUST_LOG for audit logs demo.

* Add device list to specs and demos.

* Tidy default device meta data.

* Support preferences command.

* Add preferences command test spec.

* Add preferences demo, prepare environment command.

* Support path filter for env paths command.

* Add integrity check demo.

* Add events command demo.

* Tidy device list output.

Just print the entire slice when verbose.

* Tidy audit log test script.

Use new `env` command.

* Add commands for printing enum variants.

* Add demo of the environment command.
  • Loading branch information
tmpfs authored Feb 26, 2024
1 parent 9952562 commit ba61630
Show file tree
Hide file tree
Showing 115 changed files with 1,614 additions and 691 deletions.
120 changes: 74 additions & 46 deletions Cargo.lock

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

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ parking_lot = "0.12"
indexmap = { version = "2.2", features = ["serde"] }
toml = "0.8"
bitflags = { version = "2", features = ["serde"] }
enum-iterator = "2"

[workspace.dependencies.binary-stream]
version = "8.3.0"
Expand All @@ -81,6 +82,7 @@ parking_lot.workspace = true
once_cell.workspace = true
toml.workspace = true
serde.workspace = true
enum-iterator.workspace = true
human_bytes = "0.4"
tempfile = "3.5"
shell-words = "1"
Expand Down Expand Up @@ -116,7 +118,7 @@ copy_dir = "0.1"
maplit2 = "1"
sos_test_utils = { path = "workspace/test_utils" }
pretty_assertions = "1.4"
anticipate-runner = { version = "0.4" }
anticipate-runner = { version = "0.5.1" }

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
wasm-bindgen-test = "0.3"
Expand Down
7 changes: 6 additions & 1 deletion Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ args = ["test", "audit"]
command = "cargo"
args = ["test", "backup_archive"]

[tasks.test-command-line]
command = "cargo"
args = ["test", "command_line", "--features", "enable-cli-tests", "--", "--nocapture"]
dependencies = ["clean-cli"]

[tasks.test-event-log]
command = "cargo"
args = ["test", "event_log_"]
Expand Down Expand Up @@ -121,7 +126,7 @@ args = ["test", "system_messages_"]
[tasks.clean-cli]
script = '''
rm -rf target/accounts
rm -f target/*.{zip,vcf,heic,txt}
rm -f target/*.{zip,vcf,heic,txt,toml,csv,json}
'''

[tasks.test-cli]
Expand Down
16 changes: 15 additions & 1 deletion TEST.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,22 @@ The CLI test specs can take a long time with the debug build so if you want to s
cargo make test-lite
```

To run just the command line tests which would be included in test coverage:

```
cargo make test-command-line
```

These tests always use a debug version of the executable. Run with `ANTICIPATE_ECHO` to debug:

```
ANTICIPATE_ECHO=true cargo make test-command-line
```

## Test Scripts

The test scripts make it much faster to run tests by using a release version installed with `cargo install --path .`.

To run the CLI test specs using the first version of `sos` in `PATH`:

```
Expand All @@ -45,7 +59,7 @@ ANTICIPATE_ECHO=true cargo make test-cli
ANTICIPATE_ECHO=true cargo make test-shell
```

Run `cargo install --path .` to install a release version and make these tests much faster.
Use the `SPEC` variable to run a specific test:

## Notes

Expand Down
Loading

0 comments on commit ba61630

Please sign in to comment.