Skip to content
Draft
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
9 changes: 6 additions & 3 deletions .github/workflows/ninja_pr_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,13 @@ jobs:
working-directory: ${{ matrix.example.path }}
run: |
dfx start --background
dfx deploy
if [ -f "Makefile" ]; then
if [ -f "test.sh" ]; then
echo "test.sh found, running bash test.sh"
bash test.sh
elif [ -f "Makefile" ]; then
echo "Makefile found, running make test"
make test
else
echo "No Makefile found, skipping make test"
echo "No test.sh or Makefile found, running dfx deploy"
dfx deploy
fi
24 changes: 0 additions & 24 deletions rust/canister-info/Makefile

This file was deleted.

12 changes: 12 additions & 0 deletions rust/canister-info/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -e

dfx deploy
dfx canister call canister-info info "(principal \"`dfx canister id test`\")" --output idl | grep -x "(record.*controllers.*module_hash.*recent_changes.*creation.*code_deployment.*total_num_changes = 2.*)"
dfx canister call canister-info canister_controllers "(principal \"`dfx canister id test`\",variant {at_timestamp=`perl -MTime::HiRes=time -e 'printf "%d\n", 1e9*time'`})" --output idl | grep -x "(opt record.*vec.*`dfx identity get-principal`.*opt.*)"
dfx canister call canister-info canister_controllers "(principal \"`dfx canister id test`\",variant {at_version=2})" --output idl | grep -x "(opt record.*vec.*`dfx identity get-principal`.*null.*)"
dfx canister call canister-info canister_module_hash "(principal \"`dfx canister id test`\",variant {at_timestamp=`perl -MTime::HiRes=time -e 'printf "%d\n", 1e9*time'`})" --output idl | grep -x "(opt record.*opt.*blob.*opt.*)"
dfx canister call canister-info canister_module_hash "(principal \"`dfx canister id test`\",variant {at_version=2})" --output idl | grep -x "(opt record.*opt.*blob.*null.*)"
dfx canister call canister-info canister_deployment_chain "(principal \"`dfx canister id test`\",variant {at_timestamp=`perl -MTime::HiRes=time -e 'printf "%d\n", 1e9*time'`})" --output idl | grep -x "(record.*vec.*record.*code_deployment.*max_clock_skew.*opt.*)"
dfx canister call canister-info canister_deployment_chain "(principal \"`dfx canister id test`\",variant {at_version=2})" --output idl | grep -x "(record.*vec.*record.*code_deployment.*max_clock_skew.*null.*)"
dfx canister call canister-info reflexive_transitive_controllers "(principal \"`dfx canister id test`\")" --output idl | grep -x "(vec.*`dfx identity get-principal`.*)"
Loading