Skip to content

Commit

Permalink
Unifying testing script
Browse files Browse the repository at this point in the history
  • Loading branch information
traiansf committed Dec 21, 2024
1 parent eb0ed3c commit fd5e002
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,8 @@ jobs:
run: docker exec -u user kwasm-ci-erc20-${GITHUB_SHA} bash -c "CXX=clang++-16 make ulm-build"
- name: 'Build erc20-bin'
run: docker exec -u user kwasm-ci-erc20-${GITHUB_SHA} bash -c "CXX=clang++-16 make erc20-bin"
- name: 'Start test'
run: docker exec -u user -d -i -t kwasm-ci-erc20-${GITHUB_SHA} bash -c "(sleep 3 ; ./scripts/ulm-load-lang ./build/lib/libkwasm.so ; tests/ulm/erc20/erc20_test.sh ; tests/ulm/erc20/erc20_negative_test.sh; killall geth ) & (./scripts/run-dev-ulm &> ulm.log)"
# - name: 'Load kwasm library'
# run: docker exec -u user kwasm-ci-erc20-${GITHUB_SHA} bash -c "./scripts/ulm-load-lang ./build/lib/libkwasm.so"
# - name: 'Run ERC20 tests'
# run: docker exec -u user kwasm-ci-erc20-${GITHUB_SHA} bash -c "tests/ulm/erc20/erc20_test.sh"
# - name: 'Run ERC20 negative tests'
# run: docker exec -u user kwasm-ci-erc20-${GITHUB_SHA} bash -c "tests/ulm/erc20/erc20_negative_test.sh"
- name: 'Run ERC20 tests'
run: docker exec -u user kwasm-ci-erc20-${GITHUB_SHA} bash -c "./tests/ulm/erc20/run-tests.sh"
- name: 'Tear down Docker'
if: always()
run: |
Expand Down
2 changes: 0 additions & 2 deletions tests/ulm/erc20/erc20_negative_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ function test_transfer_too_much {
contract=$(erc20_deploy $k1)
echo -n "."

exit 0

balance2=$(erc20_balanceOf $k1 $contract $a2)
echo -n "."
assert_eq "0" "$balance2" "Balance of Account 2"
Expand Down
18 changes: 18 additions & 0 deletions tests/ulm/erc20/run_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
set -e

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
ROOT_DIR="$SCRIPT_DIR/../../.."

# change to root directory
cd "$ROOT_DIR"

./scripts/run-dev-ulm &> ulm.log &
sleep 1

./scripts/ulm-load-lang ./build/lib/libkwasm.so

tests/ulm/erc20/erc20_test.sh

tests/ulm/erc20/erc20_negative_test.sh

kill %1

0 comments on commit fd5e002

Please sign in to comment.