Skip to content

Commit

Permalink
Migrate integration tests to PocketIC
Browse files Browse the repository at this point in the history
Migrates all II integration tests to PocketIC. Since the API for
obtaining the current timestamp changed, I took the opportunity to
make better use of the `time` helper in `framework`.

Integration tests now require a `dfx` managed PocketIC instance already
running. This way, the test code does not care about the location of
the PocketIC binary.
  • Loading branch information
frederikrothenberger committed Jul 8, 2024
1 parent e7342f8 commit 09b4789
Show file tree
Hide file tree
Showing 45 changed files with 2,027 additions and 451 deletions.
27 changes: 7 additions & 20 deletions .github/workflows/canister-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -246,16 +246,8 @@ jobs:
name: internet_identity_test.wasm.gz
path: .
- run: mv internet_identity_test.wasm.gz internet_identity.wasm.gz
- name: Download ic-test-state-machine binary
run: |
uname_sys=$(uname -s | tr '[:upper:]' '[:lower:]')
echo "uname_sys: $uname_sys"
commit_sha=$(sed <.ic-commit 's/#.*$//' | sed '/^$/d')
echo "commit sha: $commit_sha"
curl -sLO "https://download.dfinity.systems/ic/$commit_sha/binaries/x86_64-$uname_sys/ic-test-state-machine.gz"
gzip -d ic-test-state-machine.gz
chmod a+x ic-test-state-machine
./ic-test-state-machine --version
- uses: dfinity/setup-dfx@e50c04f104ee4285ec010f10609483cf41e4d365
- run: dfx start --background --pocketic --clean
- name: "Run VC issuer canister tests"
working-directory: demos/vc_issuer
run: |
Expand All @@ -264,6 +256,7 @@ jobs:
touch dist/index.{html,css,js}
touch dist/index2.js
cargo test
- run: dfx stop

###########################
# The Rust canister tests #
Expand Down Expand Up @@ -359,16 +352,8 @@ jobs:
with:
name: canister-tests-${{ matrix.os }}.tar.zst
path: .
- name: Download ic-test-state-machine binary
run: |
uname_sys=$(uname -s | tr '[:upper:]' '[:lower:]')
echo "uname_sys: $uname_sys"
commit_sha=$(sed <.ic-commit 's/#.*$//' | sed '/^$/d')
echo "commit sha: $commit_sha"
curl -sLO "https://download.dfinity.systems/ic/$commit_sha/binaries/x86_64-$uname_sys/ic-test-state-machine.gz"
gzip -d ic-test-state-machine.gz
chmod a+x ic-test-state-machine
./ic-test-state-machine --version
- uses: dfinity/setup-dfx@e50c04f104ee4285ec010f10609483cf41e4d365
- run: dfx start --background --pocketic --clean

- name: 'Download II wasm'
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -399,6 +384,8 @@ jobs:
env:
RUST_BACKTRACE: 1

- run: dfx stop

######################
# The end-to-end tests #
######################
Expand Down
Loading

0 comments on commit 09b4789

Please sign in to comment.