Skip to content

Commit

Permalink
test: clean up binary before running integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianoliveira committed Jun 9, 2023
1 parent 695aefa commit 0c2d662
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ Cargo.lock
funzzy*
tests/integration/workdir/
*.log
tests/integration/release/
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ build: tests ## Execute all the tests and build funzzy binary
.PHONY: integration-cleanup
integration-cleanup:
rm -rf target && \
rm -rf tests/integration/release && \
rm -rf tests/integration/workdir && \
rm -f tests/integration/funzzy

Expand Down
11 changes: 3 additions & 8 deletions tests/integration/runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,9 @@ export WORKDIR="$TEST_DIR"/workdir
echo "Building funzzy"

rm -f "$TEST_DIR"/funzzy
# if CI build with --release flag else build with debug flag
if [ -n "$CI" ]; then
cargo build --release --target-dir "$TEST_DIR"
cp "$TEST_DIR"/release/funzzy "$TEST_DIR"/funzzy
else
cargo build --release --target-dir "$TEST_DIR"
cp "$TEST_DIR"/release/funzzy "$TEST_DIR"/funzzy
fi

cargo build --release --target-dir "$TEST_DIR"
cp "$TEST_DIR"/release/funzzy "$TEST_DIR"/funzzy

"$TEST_DIR"/funzzy --version
"$TEST_DIR"/funzzy --help
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/specs/list-of-commands-task-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ sh -c "vi +%s/test/foo/g +wq $WORKDIR/test.txt -u NONE"
assert_file_contains "$WORKDIR/output.txt" "task echo 100"
assert_file_contains "$WORKDIR/output.txt" "task echo 200"
assert_file_contains "$WORKDIR/output.txt" "task echo 4000"
assert_file_content_at "$WORKDIR/output.txt" "3333" 7
assert_file_content_at "$WORKDIR/output.txt" "3333" 10

cleanup

0 comments on commit 0c2d662

Please sign in to comment.