Skip to content

Commit

Permalink
Move tests over to bats
Browse files Browse the repository at this point in the history
  • Loading branch information
hwittenborn committed Oct 10, 2022
1 parent dd58ee2 commit 23bea37
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env just --justfile
# Some wrappers to aid in the build process during local development.
set positional-arguments

default:
Expand Down
11 changes: 11 additions & 0 deletions tests/tests.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@test "run update" {
target/debug/mist update
}

@test "search with no results" {
run ! target/debug/mist search 'nonexistent'
}

@test "list with no results" {
run ! target/debug/mist list 'nonexistent'
}
7 changes: 2 additions & 5 deletions toast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ tasks:
curl -q 'https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub' | gpg --dearmor | sudo tee /usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg 1> /dev/null
echo "deb [signed-by=/usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg] https://proget.makedeb.org prebuilt-mpr $(lsb_release -cs)" | sudo tee /etc/apt/sources.list.d/prebuilt-mpr.list
sudo apt-get update
sudo apt-get install g++ just libssl-dev libapt-pkg-dev lsb-release pkg-config rustup sudo -y
sudo apt-get install bats g++ just libssl-dev libapt-pkg-dev lsb-release pkg-config rustup sudo -y
run-tests:
dependencies: ["install-deps"]
input_paths:
Expand All @@ -22,7 +22,4 @@ tasks:
just build
run-e2e-tests:
dependencies: ["run-tests"]
command: |
./target/debug/mist update
if ./target/debug/mist search nonexistent; then echo "Missing 'search' results should not exit with status code 0" && exit 1; fi
if ./target/debug/mist list nonexistent; then echo "Missing 'list' results should not exit with status code 0" && exit 1; fi
command: bats tests/

0 comments on commit 23bea37

Please sign in to comment.