-
Notifications
You must be signed in to change notification settings - Fork 136
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
Add script test canisters #2652
Changes from 4 commits
ce745f0
c7a5637
54d49e2
22926be
caf0046
744eac6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,49 @@ | ||||||||
#!/bin/bash | ||||||||
|
||||||||
POCKET_IC_SERVER_VERSION=6.0.0 | ||||||||
POCKET_IC_SERVER_PATH="pocket-ic" | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Given you are dealing with paths here, what about making sure that the working directory really is the repository directory? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We also usually set flags to fail early on error:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea, done! |
||||||||
PREVIOUS_II_WASM_PATH="internet_identity_previous.wasm.gz" | ||||||||
PREVIOUS_ARCHIVE_WASM_PATH="archive_previous.wasm.gz" | ||||||||
|
||||||||
if [[ $OSTYPE == "linux-gnu"* ]] || [[ $RUNNER_OS == "Linux" ]]; then | ||||||||
frederikrothenberger marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
PLATFORM=linux | ||||||||
elif [[ $OSTYPE == "darwin"* ]] || [[ $RUNNER_OS == "macOS" ]]; then | ||||||||
PLATFORM=darwin | ||||||||
else | ||||||||
echo "OS not supported: ${OSTYPE:-$RUNNER_OS}" | ||||||||
exit 1 | ||||||||
fi | ||||||||
|
||||||||
if [ -f "./$PREVIOUS_II_WASM_PATH" ]; then | ||||||||
echo "Using previous II wasm." | ||||||||
else | ||||||||
echo "Downloading previous II wasm." | ||||||||
curl -sSL https://github.com/dfinity/internet-identity/releases/latest/download/internet_identity_test.wasm.gz -o ${PREVIOUS_II_WASM_PATH} | ||||||||
fi | ||||||||
|
||||||||
if [ -f "./$PREVIOUS_ARCHIVE_WASM_PATH" ]; then | ||||||||
echo "Using previous Archive wasm." | ||||||||
else | ||||||||
echo "Downloading previous Archive wasm." | ||||||||
curl -sSL https://github.com/dfinity/internet-identity/releases/latest/download/archive.wasm.gz -o ${PREVIOUS_ARCHIVE_WASM_PATH} | ||||||||
fi | ||||||||
|
||||||||
if [ ! -f "$POCKET_IC_SERVER_PATH" ]; then | ||||||||
echo "Downloading PocketIC." | ||||||||
curl -sSL https://github.com/dfinity/pocketic/releases/download/${POCKET_IC_SERVER_VERSION}/pocket-ic-x86_64-${PLATFORM}.gz -o ${POCKET_IC_SERVER_PATH}.gz | ||||||||
gunzip ${POCKET_IC_SERVER_PATH}.gz | ||||||||
chmod +x ${POCKET_IC_SERVER_PATH} | ||||||||
else | ||||||||
echo "PocketIC server already exists, skipping download." | ||||||||
fi | ||||||||
|
||||||||
# Build II | ||||||||
II_FETCH_ROOT_KEY=1 II_DUMMY_CAPTCHA=1 ./scripts/build --internet-identity | ||||||||
|
||||||||
# Build Archive | ||||||||
./scripts/build --archive | ||||||||
|
||||||||
# Run tests | ||||||||
|
||||||||
echo "Running integration tests." | ||||||||
cargo test "${@}" | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only script with multiple dots in the name. What about calling it
test-canisters.sh
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good point.