Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: run integration tests against PocketIC #607

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 35 additions & 7 deletions .github/workflows/ic-ref.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
strategy:
matrix:
build: [linux-stable]
pocket-ic: ["replica", "pocketic"]
include:
- build: linux-stable
ic-hs-ref: "3d71032e"
Expand All @@ -28,7 +29,7 @@ jobs:
- name: Install dfx
uses: dfinity/setup-dfx@main
with:
dfx-version: "0.22.0-beta.0"
dfx-version: "0.24.2"

- name: Cargo cache
uses: actions/cache@v4
Expand All @@ -53,11 +54,20 @@ jobs:
- name: Run Integration Tests
run: |
set -ex
dfx start --background --clean
if [[ "${{ matrix.pocket-ic }}" == "replica" ]]
then
dfx start --background --clean
else
dfx start --background --clean --pocketic
fi
sleep 1
export IC_REF_PORT=$(dfx info replica-port)
export IC_REF_PORT=$(dfx info webserver-port)
export IC_UNIVERSAL_CANISTER_PATH=$HOME/canister.wasm
export IC_WALLET_CANISTER_PATH=$HOME/wallet.wasm
if [[ "${{ matrix.pocket-ic }}" == "pocketic" ]]
then
export POCKET_IC="http://localhost:${IC_REF_PORT}"
fi
cargo test --all-features -- --ignored
dfx stop
env:
Expand All @@ -79,11 +89,20 @@ jobs:
# create key:
pkcs11-tool -k --module $HSM_PKCS11_LIBRARY_PATH --login --slot-index $HSM_SLOT_INDEX -d $HSM_KEY_ID --key-type EC:prime256v1 --pin $HSM_PIN

dfx start --background --clean
if [[ "${{ matrix.pocket-ic }}" == "replica" ]]
then
dfx start --background --clean
else
dfx start --background --clean --pocketic
fi
sleep 1
export IC_REF_PORT=$(dfx info replica-port)
export IC_REF_PORT=$(dfx info webserver-port)
export IC_UNIVERSAL_CANISTER_PATH=$HOME/canister.wasm
export IC_WALLET_CANISTER_PATH=$HOME/wallet.wasm
if [[ "${{ matrix.pocket-ic }}" == "pocketic" ]]
then
export POCKET_IC="http://localhost:${IC_REF_PORT}"
fi
cd ref-tests
cargo test --all-features -- --ignored --nocapture --test-threads=1
dfx stop
Expand All @@ -98,9 +117,18 @@ jobs:
- name: Run Doc Tests
run: |
set -ex
dfx start --background --clean
if [[ "${{ matrix.pocket-ic }}" == "replica" ]]
then
dfx start --background --clean
else
dfx start --background --clean --pocketic
fi
sleep 1
export IC_REF_PORT=$(dfx info replica-port)
export IC_REF_PORT=$(dfx info webserver-port)
if [[ "${{ matrix.pocket-ic }}" == "pocketic" ]]
then
export POCKET_IC="http://localhost:${IC_REF_PORT}"
fi
cargo test --all-features --doc -- --ignored
dfx stop
env:
Expand Down
Loading