-
Notifications
You must be signed in to change notification settings - Fork 142
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ce745f0
Add new metrocs to monitor memory
lmuntaner c7a5637
Remove file
lmuntaner 54d49e2
Import page size constant and multiply integers
lmuntaner 22926be
Create script to run canisters tests
lmuntaner caf0046
CR changes
lmuntaner 744eac6
CR changes
lmuntaner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
POCKET_IC_SERVER_VERSION=6.0.0 | ||
POCKET_IC_SERVER_PATH="pocket-ic" | ||
PREVIOUS_II_WASM_PATH="internet_identity_previous.wasm.gz" | ||
PREVIOUS_ARCHIVE_WASM_PATH="archive_previous.wasm.gz" | ||
|
||
# Check if the script is run from the root of the project | ||
project_root=$(git rev-parse --show-toplevel 2>/dev/null) | ||
if [ "$project_root" != "$(pwd)" ]; then | ||
echo "Please run this script from the root of the project." | ||
exit 1 | ||
fi | ||
|
||
RUNNER_OS=${RUNNER_OS:-} | ||
if [[ $OSTYPE == "linux-gnu"* ]] || [[ $RUNNER_OS == "Linux" ]]; then | ||
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 "${@}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We normally just switch to the appropriate directory:
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.
Ah, ok, changed!