-
Notifications
You must be signed in to change notification settings - Fork 96
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
test: command run automation #100
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
ac66efb
test: command run automation
pcheremu 25145e1
test: fix install
pcheremu e314290
test: fix tests
pcheremu 86842b4
test: refactoring
pcheremu 53cfd7e
test: refactoring
pcheremu 9b838b0
test: refactoring
pcheremu dc9d748
test: refactoring
pcheremu e25b309
test: refactoring
pcheremu 8dc1b8c
test: refactoring
pcheremu 21904e4
test: refactoring
pcheremu 81da371
test: refactoring
pcheremu 1a94f8c
test: refactoring
pcheremu 18a8ffe
test: refactoring
pcheremu 5bd2d71
test: refactoring
pcheremu ff979d7
test: refactoring
pcheremu c2dbc76
test: refactoring
pcheremu 82d5d76
test: refactoring
pcheremu 9558b51
test: refactoring
pcheremu 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Tests | ||
|
||
on: pull_request | ||
|
||
|
||
jobs: | ||
preparation_and_running_tests: | ||
permissions: | ||
contents: read | ||
strategy: | ||
matrix: | ||
os: [ | ||
ubuntu-latest, | ||
windows-latest, | ||
macos-latest | ||
] | ||
node-version: ['lts/*', '18.17.1'] # or 18.17.1 | ||
tags: [ | ||
"default" | ||
] | ||
runs-on: ${{matrix.os}} | ||
|
||
name: 'Node ${{ matrix.node-version}} / ${{ matrix.os}}' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: npm | ||
|
||
- name: Install dependencies | ||
run: | | ||
npm i zksync-cli | ||
|
||
- name: Run tests | ||
run: | | ||
./src/tests/test_zksync_cli.sh | ||
shell: bash | ||
|
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,107 @@ | ||
#!/bin/bash | ||
|
||
declare -i counter_failed=0 | ||
declare -i counter_total=0 | ||
declare -i RESULT=0 | ||
|
||
verify_result () { | ||
RESULT=$? | ||
counter_total+=1 | ||
if [ $RESULT -eq 0 ]; then | ||
echo "" | ||
echo "-----------> SUCCESS <-----------" | ||
echo " " | ||
else | ||
echo "" | ||
echo "-----------> FAILED <-----------" | ||
echo " " | ||
counter_failed+=1 | ||
fi | ||
} | ||
|
||
echo "INFO" | ||
|
||
echo "node:" | ||
node --version | ||
echo "npm:" | ||
npm --version | ||
echo "docker:" | ||
docker --version | ||
|
||
#BASIC | ||
|
||
echo "Test #1717" | ||
echo "---------------------------------" | ||
|
||
echo "> npx zksync-cli -V" | ||
npx zksync-cli -V | ||
verify_result | ||
|
||
echo "> npx zksync-cli --version" | ||
npx zksync-cli --version | ||
verify_result | ||
|
||
### | ||
|
||
echo "Test #1734" | ||
echo "---------------------------------" | ||
|
||
echo "> npx zksync-cli --help" | ||
npx zksync-cli --help | ||
verify_result | ||
|
||
echo "---------------------------------" | ||
echo "> npx zksync-cli --help deposit" | ||
npx zksync-cli --help deposit | ||
verify_result | ||
|
||
### | ||
|
||
echo "Test #1714" | ||
echo "---------------------------------" | ||
|
||
echo "> npx zksync-cli -h" | ||
npx zksync-cli -h | ||
verify_result | ||
|
||
echo "---------------------------------" | ||
echo "> npx zksync-cli --help" | ||
npx zksync-cli --help | ||
verify_result | ||
|
||
### | ||
|
||
echo "Test #1715" | ||
echo "---------------------------------" | ||
|
||
echo "npx zksync-cli dev -h" | ||
npx zksync-cli dev -h | ||
verify_result | ||
|
||
echo "---------------------------------" | ||
echo "npx zksync-cli dev --help" | ||
npx zksync-cli dev --help | ||
verify_result | ||
|
||
echo "---------------------------------" | ||
echo "npx zksync-cli dev --help start" | ||
npx zksync-cli dev --help start | ||
verify_result | ||
|
||
### | ||
|
||
echo "Test #1719" | ||
echo "---------------------------------" | ||
|
||
echo "> zksync-cli dev modules" | ||
npx zksync-cli dev modules | ||
verify_result | ||
|
||
### | ||
|
||
if [ $counter_failed == 0 ]; then | ||
echo "$counter_total tests Passed" | ||
else | ||
echo "Fail. $counter_failed failed test(s)" | ||
exit 1 # terminate and indicate error | ||
fi |
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.
Are those test scenarios related to the testing docs?
If it really is, does that make sense to add some relation testing docs-script?