Skip to content

Commit

Permalink
refactor!: black-box integration tests
Browse files Browse the repository at this point in the history
Signed-off-by: 0x009922 <[email protected]>

fix: lints, correct upload of `executor.wasm`

Signed-off-by: 0x009922 <[email protected]>

fix: make `iroha_core` compile without `telemetry` feature

Signed-off-by: 0x009922 <[email protected]>

ci: copy executor from script; debug; single test command

Signed-off-by: 0x009922 <[email protected]>

ci: remove debug, enable full tests

And remove extra `iroha_wasm_builder` dependency

Signed-off-by: 0x009922 <[email protected]>

chore: remove rebase artifact

Signed-off-by: 0x009922 <[email protected]>

ci: upload test network artifacts

Signed-off-by: 0x009922 <[email protected]>

ci: add `ci` nextest profile

Signed-off-by: 0x009922 <[email protected]>
  • Loading branch information
0x009922 committed Oct 9, 2024
1 parent 7473d04 commit 497ee50
Show file tree
Hide file tree
Showing 79 changed files with 3,875 additions and 4,493 deletions.
5 changes: 5 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[profile.ci]
retries = 2
fail-fast = false
failure-output = "immediate-final"

92 changes: 22 additions & 70 deletions .github/workflows/iroha2-dev-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ env:
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
TEST_NETWORK_TMP_DIR: /tmp

jobs:
consistency:
Expand Down Expand Up @@ -83,7 +84,7 @@ jobs:
path: ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm
retention-days: 1

unit_tests_with_coverage:
test_with_coverage:
runs-on: [self-hosted, Linux, iroha2]
container:
image: hyperledger/iroha2-ci:nightly-2024-09-09
Expand All @@ -92,94 +93,45 @@ jobs:
LLVM_PROFILE_FILE_NAME: "iroha-%p-%m.profraw"
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@nextest
- uses: taiki-e/install-action@cargo-llvm-cov
- name: Download executor.wasm
uses: actions/download-artifact@v4
with:
name: executor.wasm
path: ${{ env.DOCKER_COMPOSE_PATH }}
- uses: taiki-e/install-action@nextest
- uses: taiki-e/install-action@cargo-llvm-cov
- name: Run unit tests (no default features)
- name: Download the rest of WASM samples
uses: actions/download-artifact@v4
with:
name: wasm_samples
path: ${{ env.WASM_SAMPLES_TARGET_DIR }}
- name: Install irohad
run: which irohad || cargo install --path crates/irohad --locked
- name: Test with no default features
run: >
mold --run cargo llvm-cov nextest
--no-fail-fast
--workspace --lib
--profile ci
--no-default-features
--branch
--no-report
- name: Run unit tests (all features)
--branch --no-report
- name: Test with all features
run: >
mold --run cargo llvm-cov nextest
--no-fail-fast
--workspace --lib
--profile ci
--all-features
--branch
--no-report
--branch --no-report
- name: Generate lcov report
run: cargo llvm-cov report --lcov --output-path lcov.info
- name: Upload lcov report
uses: actions/upload-artifact@v4
with:
name: report-coverage
path: lcov.info

# include: iroha/tests/integration/
# exclude: iroha/tests/integration/extra_functional
integration:
runs-on: [self-hosted, Linux, iroha2]
container:
image: hyperledger/iroha2-ci:nightly-2024-09-09
needs: build_wasm_samples
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Download executor.wasm
uses: actions/download-artifact@v4
with:
name: executor.wasm
path: ${{ env.DOCKER_COMPOSE_PATH }}
- name: Download the rest of WASM samples
uses: actions/download-artifact@v4
with:
name: wasm_samples
path: ${{ env.WASM_SAMPLES_TARGET_DIR }}
- 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_wasm_samples
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- name: Download executor.wasm
uses: actions/download-artifact@v4
with:
name: executor.wasm
path: ${{ env.DOCKER_COMPOSE_PATH }}
- name: Download the rest of WASM samples
uses: actions/download-artifact@v4
- name: Upload test network artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: wasm_samples
path: ${{ env.WASM_SAMPLES_TARGET_DIR }}
- 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)'
name: test_network_runs
path: ${{ env.TEST_NETWORK_TMP_DIR }}/irohad_test_network_*

# Run the job to check that the docker containers are properly buildable
pr-generator-build:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ result
/lcov.info
test_docker
**/*.wasm
.iroha_test_network_run.json*
Loading

0 comments on commit 497ee50

Please sign in to comment.