Skip to content
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

refactor!: black-box integration tests #5124

Merged
merged 22 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
ee52117
refactor!: black-box integration tests
0x009922 Sep 19, 2024
8a6782e
fix: chores after rebase; print STDERR; handle early peer termination
0x009922 Oct 11, 2024
3d0e221
chore: update Cargo.lock
0x009922 Oct 11, 2024
eb2154b
doc: write known issues with ports locking
0x009922 Oct 11, 2024
09e65a9
ci: use `NEXTEST_PROFILE` env var
0x009922 Oct 11, 2024
a435d7e
refactor: chores
0x009922 Oct 11, 2024
1545f24
test: include fetch size test back
0x009922 Oct 11, 2024
3e28fdf
test: include genesis validation test back
0x009922 Oct 11, 2024
b5a6b1d
test: simplify parameter setting test
0x009922 Oct 11, 2024
83557c2
chore: remove wasms building from pre-commit.sample
0x009922 Oct 16, 2024
5fd7878
refactor: print stderr on drop; remove commented code
0x009922 Oct 16, 2024
023d132
chore: fix cargo suggestion, add `--path`
0x009922 Oct 16, 2024
5ab1714
refactor: replace `consensus_estimation` with `pipeline_time`
0x009922 Oct 16, 2024
76864e4
test: adjust nextest profiles
0x009922 Oct 16, 2024
14b7f4f
chore: update comment about kura test
0x009922 Oct 16, 2024
de61fd5
revert: redundant assert from #5140
0x009922 Oct 17, 2024
db0b1e3
chore: remove commented code
0x009922 Oct 17, 2024
e61cd9c
ci: set retention days to 3 for test network runs
0x009922 Oct 17, 2024
6c7af36
ci: upload artifacts only on failure
0x009922 Oct 17, 2024
435387c
chore: use `expect`
0x009922 Oct 18, 2024
05da0bd
ci: refine artifacts upload policy
0x009922 Oct 18, 2024
b729267
Merge branch 'main' into black-box-test-network
mversic Oct 18, 2024
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
8 changes: 8 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[profile.default]
retries = 2

[profile.ci]
fail-fast = false
failure-output = "immediate-final"
slow-timeout = { period = "30s", terminate-after = 2 }

94 changes: 24 additions & 70 deletions .github/workflows/iroha2-dev-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ 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
NEXTEST_PROFILE: ci

jobs:
consistency:
Expand Down Expand Up @@ -83,7 +85,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 +94,46 @@ 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
id: test_no_features
run: >
mold --run cargo llvm-cov nextest
--no-fail-fast
--workspace --lib
--no-default-features
--branch
--no-report
- name: Run unit tests (all features)
--branch --no-report
- name: Test with all features
id: test_all_features
run: >
mold --run cargo llvm-cov nextest
--no-fail-fast
--workspace --lib
--all-features
--branch
--no-report
--branch --no-report
- name: Generate lcov report
run: cargo llvm-cov report --text --output-path coverage.txt
- name: Upload lcov report
uses: actions/upload-artifact@v4
with:
name: report-coverage
path: coverage.txt

# 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: failure() && (steps.test_no_features.outcome == 'failure' || steps.test_all_features.outcome == 'failure')
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_*
0x009922 marked this conversation as resolved.
Show resolved Hide resolved
retention-days: 3

# Run the job to check that the docker containers are properly buildable
pr-generator-build:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/iroha2-pr-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ concurrency:

env:
CARGO_TERM_COLOR: always
NEXTEST_PROFILE: ci

jobs:
tests:
Expand All @@ -31,4 +32,4 @@ jobs:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@nextest
- name: Run UI tests, with ${{ matrix.feature_flag }}
run: mold --run cargo nextest run --no-fail-fast -E 'test(ui)' --${{ matrix.feature_flag }}
run: mold --run cargo nextest run -E 'test(ui)' --${{ matrix.feature_flag }}
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
Loading