Skip to content

Commit

Permalink
refactor!: black-box integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
0x009922 committed Oct 2, 2024
1 parent f7dfd7d commit 8e5b726
Show file tree
Hide file tree
Showing 80 changed files with 3,624 additions and 4,417 deletions.
52 changes: 21 additions & 31 deletions .github/workflows/iroha2-dev-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ env:
CARGO_TERM_COLOR: always
IROHA_CLI_DIR: "/__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}/test"
DOCKER_COMPOSE_PATH: defaults
WASM_SAMPLES_TARGET_DIR: wasm_samples/target/prebuilt

jobs:
consistency:
Expand Down Expand Up @@ -60,16 +61,22 @@ jobs:
name: report-clippy
path: clippy.json

build_executor:
build_wasm_samples:
runs-on: ubuntu-latest
container:
image: hyperledger/iroha2-ci:nightly-2024-09-09
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Build iroha executor
run: mold --run cargo run --bin iroha_wasm_builder -- build ./wasm_samples/default_executor --optimize --out-file ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm
- name: Upload executor to reuse in other jobs
- name: Build
run: ./scripts/build_wasm_samples.sh
- name: Upload all built WASMs
uses: actions/upload-artifact@v4
with:
name: wasm_samples
path: ${{ env.WASM_SAMPLES_TARGET_DIR }}
retention-days: 1
- name: Upload executor.wasm specifically
uses: actions/upload-artifact@v4
with:
name: executor.wasm
Expand All @@ -80,7 +87,7 @@ jobs:
runs-on: [self-hosted, Linux, iroha2]
container:
image: hyperledger/iroha2-ci:nightly-2024-09-09
needs: build_executor
needs: build_wasm_samples
env:
LLVM_PROFILE_FILE_NAME: "iroha-%p-%m.profraw"
steps:
Expand Down Expand Up @@ -122,7 +129,7 @@ jobs:
runs-on: [self-hosted, Linux, iroha2]
container:
image: hyperledger/iroha2-ci:nightly-2024-09-09
needs: build_executor
needs: build_wasm_samples
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
Expand All @@ -131,38 +138,21 @@ jobs:
with:
name: executor.wasm
path: ${{ env.DOCKER_COMPOSE_PATH }}
- uses: taiki-e/install-action@nextest
- name: Run integration tests, with all features
run: >
mold --run cargo nextest run
--all-features
--no-fail-fast
--failure-output immediate-final
-E 'package(iroha) and test(integration) and not test(extra_functional)'
# include: iroha/tests/integration/extra_functional
extra_functional:
runs-on: [self-hosted, Linux, iroha2]
container:
image: hyperledger/iroha2-ci:nightly-2024-09-09
needs: build_executor
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- name: Download executor.wasm
- name: Download the rest of WASM samples
uses: actions/download-artifact@v4
with:
name: executor.wasm
path: ${{ env.DOCKER_COMPOSE_PATH }}
name: wasm_samples
path: ${{ env.WASM_SAMPLES_TARGET_DIR }}
- name: Install irohad
run: which irohad || cargo install --path crates/irohad --locked
- uses: taiki-e/install-action@nextest
- name: Run integration tests, with all features
run: >
mold --run cargo nextest run
--all-features
--no-fail-fast
--failure-output final
--test-threads 1
-E 'test(extra_functional)'
--failure-output immediate-final
-E 'package(iroha) and test(integration)'
# Run the job to check that the docker containers are properly buildable
pr-generator-build:
Expand Down Expand Up @@ -198,7 +188,7 @@ jobs:
context: .

docker-compose-and-pytests:
needs: build_executor
needs: build_wasm_samples
runs-on: [self-hosted, Linux, iroha2]
timeout-minutes: 60
env:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ result
/test/
/iroha-java/
/lcov.info
**/test-smartcontracts/
test_docker
**/*.wasm
.iroha_test_network_run.json*
Loading

0 comments on commit 8e5b726

Please sign in to comment.