Skip to content

Commit

Permalink
Fix CI attempt 10
Browse files Browse the repository at this point in the history
  • Loading branch information
jgur-psyops committed Sep 25, 2024
1 parent 88b3f5c commit 73e74ce
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,19 +138,18 @@ jobs:
- name: Build marginfi program
run: anchor build -p marginfi -- --no-default-features

- name: Build liquidity incentive program
run: anchor build -p liquidity_incentive_program -- --no-default-features

- name: Build mocks program
run: anchor build -p mocks

# Handles extraneous (os error 2) that appears during testing in some versions of solana. See:
# https://solana.stackexchange.com/questions/1648/error-no-such-file-or-directory-os-error-2-error-from-anchor-test
- name: Run Anchor tests
run: |
set -o pipefail
set +e
anchor test --skip-build 2>&1 | tee test_output.log
ANCHOR_EXIT_CODE=$?
set -e
if grep -q "failing" test_output.log; then
echo "Real test failure detected."
exit 1
Expand All @@ -159,8 +158,13 @@ jobs:
if grep -q "No such file or directory (os error 2)" test_output.log; then
echo "Extraneous error detected, ignoring it..."
exit 0
fi
if [ $ANCHOR_EXIT_CODE -ne 0 ]; then
echo "Anchor test exited with code $ANCHOR_EXIT_CODE due to an unexpected error."
exit 1
else
echo "Test run completed without extraneous errors."
echo "Test run completed successfully without extraneous errors."
exit 0
fi
Expand Down
2 changes: 1 addition & 1 deletion Anchor.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ test = "RUST_LOG= yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/*.spec.t
# test = "RUST_LOG= yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/s*.spec.ts --exit --require tests/rootHooks.ts"

[test]
startup_wait = 240000
startup_wait = 60000
shutdown_wait = 2000
upgradeable = false

Expand Down

0 comments on commit 73e74ce

Please sign in to comment.