-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(e2e): add e2e framework (
bats
), add e2e CI, and update source …
…code of test files (#17)
- Loading branch information
Marcin Nowak-Liebiediew
authored
Jun 30, 2023
1 parent
4d88e5d
commit 02d11ad
Showing
26 changed files
with
705 additions
and
48 deletions.
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,43 @@ | ||
name: Run e2e tests | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
test-extension: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ macos-12, ubuntu-22.04 ] | ||
test_file_path: [ extensions/nns/e2e/tests/nns.bash, extensions/sns/e2e/tests/sns.bash ] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: 'recursive' | ||
- name: Install brew | ||
uses: Homebrew/actions/setup-homebrew@master | ||
if: contains(matrix.os, 'macos-12') == false | ||
- name: Install sponge and timeout | ||
run: brew install coreutils sponge | ||
- name: Install IC SDK (dfx) | ||
run: DFX_VERSION="0.14.2-beta.1" sh -ci "$(curl -sSL https://internetcomputer.org/install.sh)" | ||
- name: run test | ||
run: timeout 2400 e2e/bats/bin/bats ${{ matrix.test_file_path }} | ||
|
||
aggregate: | ||
name: e2e:required | ||
if: ${{ always() }} | ||
needs: [test-extension] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: check e2e test result | ||
if: ${{ needs.test-extension.result != 'success' }} | ||
run: exit 1 |
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,9 @@ | ||
[submodule "e2e/bats"] | ||
path = e2e/bats | ||
url = https://github.com/bats-core/bats-core.git | ||
[submodule "e2e/bats-support"] | ||
path = e2e/bats-support | ||
url = https://github.com/bats-core/bats-support.git | ||
[submodule "e2e/bats-assert"] | ||
path = e2e/bats-assert | ||
url = https://github.com/bats-core/bats-assert.git |
Submodule bats-assert
added at
44913f
Submodule bats-support
added at
3c8fad
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,5 @@ | ||
import socket | ||
|
||
with socket.socket() as s: | ||
s.bind(('', 0)) | ||
print(s.getsockname()[1], end='') |
Oops, something went wrong.