|
1 |
| -## |
2 |
| -## Bitcoin Integration Tests |
3 |
| -## |
| 1 | +## Github workflow to run bitcoin tests |
4 | 2 |
|
5 |
| -name: Bitcoin Integration Tests |
6 |
| - |
7 |
| -# Only run when: |
8 |
| -# - PRs are (re)opened against master branch |
| 3 | +name: Tests::Bitcoin |
9 | 4 |
|
10 | 5 | on:
|
11 |
| - pull_request: |
12 |
| - types: |
13 |
| - - opened |
14 |
| - - reopened |
| 6 | + workflow_call: |
| 7 | + |
| 8 | +defaults: |
| 9 | + run: |
| 10 | + shell: bash |
| 11 | + |
| 12 | +## env vars are transferred to composite action steps |
| 13 | +env: |
| 14 | + BITCOIND_TEST: 1 |
| 15 | + RUST_BACKTRACE: full |
| 16 | + SEGMENT_DOWNLOAD_TIMEOUT_MINS: 15 |
| 17 | + RETRIES: 3 |
| 18 | + RETRY_DELAY: 10000 |
| 19 | + TEST_TIMEOUT: 30 |
| 20 | + TEST_RETRIES: 2 |
15 | 21 |
|
16 | 22 | concurrency:
|
17 |
| - group: stacks-bitcoin-integration-tests-${{ github.ref }} |
18 |
| - # Only cancel in progress if this is for a PR |
| 23 | + group: bitcoin-tests-${{ github.head_ref || github.ref || github.run_id}} |
| 24 | + ## Only cancel in progress if this is for a PR |
19 | 25 | cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
20 | 26 |
|
21 | 27 | jobs:
|
22 |
| - # Create bitcoin image used for later tests |
23 |
| - build-integration-image: |
24 |
| - name: Build Image |
| 28 | + # Bitcoin integration tests with code coverage |
| 29 | + integration-tests: |
| 30 | + name: Integration Tests |
25 | 31 | runs-on: ubuntu-latest
|
26 |
| - steps: |
27 |
| - - name: Checkout the latest code |
28 |
| - id: git_checkout |
29 |
| - uses: actions/checkout@v3 |
30 |
| - |
31 |
| - - name: Reclaim disk space |
32 |
| - id: cleanup |
33 |
| - run: | |
34 |
| - sudo apt-get update |
35 |
| - sudo apt-get remove -y '^dotnet-.*' |
36 |
| - sudo apt-get remove -y '^llvm-.*' |
37 |
| - sudo apt-get remove -y 'php.*' |
38 |
| - sudo apt-get remove -y '^mongodb-.*' |
39 |
| - sudo apt-get remove -y '^mysql-.*' |
40 |
| - sudo apt-get autoremove -y |
41 |
| - sudo apt-get clean |
42 |
| - docker system prune --force |
43 |
| -
|
44 |
| - - name: Build bitcoin integration testing image |
45 |
| - id: build_docker_image |
46 |
| - env: |
47 |
| - DOCKER_BUILDKIT: 1 |
48 |
| - # Remove .dockerignore file so codecov has access to git info and build the image |
49 |
| - run: | |
50 |
| - rm .dockerignore |
51 |
| - docker build -f ./.github/actions/bitcoin-int-tests/Dockerfile.generic.bitcoin-tests -t stacks-blockchain:integrations . |
52 |
| -
|
53 |
| - - name: Export docker image as tarball |
54 |
| - id: export_docker_image |
55 |
| - run: docker save stacks-blockchain:integrations | gzip > integration-image.tar.gz |
56 |
| - |
57 |
| - - name: Upload built docker image |
58 |
| - id: upload_docker_image |
59 |
| - uses: actions/upload-artifact@v3 |
60 |
| - with: |
61 |
| - name: integration-image.tar.gz |
62 |
| - path: integration-image.tar.gz |
63 |
| - |
64 |
| - # Run integration tests using sampled genesis block |
65 |
| - sampled-genesis: |
66 |
| - name: Sampled Genesis |
67 |
| - runs-on: ubuntu-latest |
68 |
| - needs: |
69 |
| - - build-integration-image |
70 | 32 | strategy:
|
| 33 | + ## Continue with the test matrix even if we've had a failure |
71 | 34 | fail-fast: false
|
| 35 | + ## Run a maximum of 32 concurrent tests from the test matrix |
| 36 | + max-parallel: 32 |
72 | 37 | matrix:
|
73 | 38 | test-name:
|
74 |
| - - tests::neon_integrations::miner_submit_twice |
75 |
| - - tests::neon_integrations::microblock_integration_test |
76 |
| - - tests::neon_integrations::microblock_fork_poison_integration_test |
77 |
| - - tests::neon_integrations::size_check_integration_test |
78 |
| - - tests::neon_integrations::cost_voting_integration |
| 39 | + - tests::bitcoin_regtest::bitcoind_integration_test |
79 | 40 | - tests::integrations::integration_test_get_info
|
| 41 | + - tests::neon_integrations::antientropy_integration_test ## forced failure |
| 42 | + - tests::neon_integrations::bad_microblock_pubkey |
| 43 | + - tests::neon_integrations::bitcoind_forking_test |
80 | 44 | - tests::neon_integrations::bitcoind_integration_test
|
| 45 | + - tests::neon_integrations::block_large_tx_integration_test |
| 46 | + - tests::neon_integrations::block_limit_hit_integration_test |
| 47 | + - tests::neon_integrations::cost_voting_integration |
| 48 | + - tests::neon_integrations::filter_long_runtime_tx_integration_test |
| 49 | + - tests::neon_integrations::filter_low_fee_tx_integration_test |
| 50 | + - tests::neon_integrations::fuzzed_median_fee_rate_estimation_test_window10 |
| 51 | + - tests::neon_integrations::fuzzed_median_fee_rate_estimation_test_window5 |
81 | 52 | - tests::neon_integrations::liquid_ustx_integration
|
82 |
| - - tests::neon_integrations::stx_transfer_btc_integration_test |
83 |
| - - tests::neon_integrations::stx_delegate_btc_integration_test |
84 |
| - - tests::neon_integrations::bitcoind_forking_test |
85 |
| - - tests::neon_integrations::should_fix_2771 |
86 |
| - - tests::neon_integrations::pox_integration_test |
| 53 | + - tests::neon_integrations::microblock_fork_poison_integration_test |
| 54 | + - tests::neon_integrations::microblock_integration_test |
| 55 | + - tests::neon_integrations::microblock_large_tx_integration_test_FLAKY |
| 56 | + - tests::neon_integrations::microblock_limit_hit_integration_test |
| 57 | + - tests::neon_integrations::miner_submit_twice |
87 | 58 | - tests::neon_integrations::mining_events_integration_test
|
88 |
| - - tests::bitcoin_regtest::bitcoind_integration_test |
89 |
| - - tests::should_succeed_handling_malformed_and_valid_txs |
| 59 | + - tests::neon_integrations::pox_integration_test |
| 60 | + - tests::neon_integrations::push_boot_receipts |
| 61 | + - tests::neon_integrations::runtime_overflow_unconfirmed_microblocks_integration_test |
| 62 | + - tests::neon_integrations::should_fix_2771 |
| 63 | + - tests::neon_integrations::size_check_integration_test |
| 64 | + - tests::neon_integrations::size_overflow_unconfirmed_invalid_stream_microblocks_integration_test |
90 | 65 | - tests::neon_integrations::size_overflow_unconfirmed_microblocks_integration_test
|
91 | 66 | - tests::neon_integrations::size_overflow_unconfirmed_stream_microblocks_integration_test
|
92 |
| - - tests::neon_integrations::size_overflow_unconfirmed_invalid_stream_microblocks_integration_test |
93 |
| - - tests::neon_integrations::runtime_overflow_unconfirmed_microblocks_integration_test |
94 |
| - - tests::neon_integrations::antientropy_integration_test |
95 |
| - - tests::neon_integrations::filter_low_fee_tx_integration_test |
96 |
| - - tests::neon_integrations::filter_long_runtime_tx_integration_test |
97 |
| - - tests::neon_integrations::microblock_large_tx_integration_test_FLAKY |
98 |
| - - tests::neon_integrations::block_large_tx_integration_test |
99 |
| - - tests::neon_integrations::microblock_limit_hit_integration_test |
100 |
| - - tests::neon_integrations::block_limit_hit_integration_test |
101 |
| - - tests::neon_integrations::fuzzed_median_fee_rate_estimation_test_window5 |
102 |
| - - tests::neon_integrations::fuzzed_median_fee_rate_estimation_test_window10 |
103 |
| - - tests::neon_integrations::use_latest_tip_integration_test |
104 |
| - - tests::neon_integrations::test_flash_block_skip_tenure |
| 67 | + - tests::neon_integrations::stx_delegate_btc_integration_test |
| 68 | + - tests::neon_integrations::stx_transfer_btc_integration_test |
105 | 69 | - tests::neon_integrations::test_chainwork_first_intervals
|
106 | 70 | - tests::neon_integrations::test_chainwork_partial_interval
|
107 |
| - - tests::neon_integrations::test_problematic_txs_are_not_stored |
| 71 | + - tests::neon_integrations::test_flash_block_skip_tenure |
108 | 72 | - tests::neon_integrations::test_problematic_blocks_are_not_mined
|
109 | 73 | - tests::neon_integrations::test_problematic_blocks_are_not_relayed_or_stored
|
110 | 74 | - tests::neon_integrations::test_problematic_microblocks_are_not_mined
|
111 | 75 | - tests::neon_integrations::test_problematic_microblocks_are_not_relayed_or_stored
|
112 |
| - - tests::neon_integrations::push_boot_receipts |
113 |
| - - tests::epoch_205::test_dynamic_db_method_costs |
114 |
| - - tests::epoch_205::transition_empty_blocks |
115 |
| - - tests::epoch_205::test_cost_limit_switch_version205 |
116 |
| - - tests::epoch_205::test_exact_block_costs |
117 |
| - - tests::epoch_205::bigger_microblock_streams_in_2_05 |
118 |
| - - tests::epoch_21::transition_adds_burn_block_height |
119 |
| - - tests::epoch_21::transition_fixes_bitcoin_rigidity |
120 |
| - - tests::epoch_21::transition_adds_pay_to_contract |
121 |
| - - tests::epoch_21::transition_adds_get_pox_addr_recipients |
122 |
| - - tests::epoch_21::transition_adds_mining_from_segwit |
123 |
| - - tests::epoch_21::transition_removes_pox_sunset |
124 |
| - - tests::epoch_21::transition_empty_blocks |
125 |
| - - tests::epoch_21::test_pox_reorgs_three_flaps |
126 |
| - - tests::epoch_21::test_pox_reorg_one_flap |
127 |
| - - tests::epoch_21::test_pox_reorg_flap_duel |
128 |
| - - tests::epoch_21::test_pox_reorg_flap_reward_cycles |
129 |
| - - tests::epoch_21::test_pox_missing_five_anchor_blocks |
130 |
| - - tests::epoch_21::test_sortition_divergence_pre_21 |
131 |
| - - tests::epoch_21::test_v1_unlock_height_with_current_stackers |
132 |
| - - tests::epoch_21::test_v1_unlock_height_with_delay_and_current_stackers |
133 |
| - - tests::epoch_21::trait_invocation_cross_epoch |
134 |
| - - tests::epoch_22::pox_2_unlock_all |
135 |
| - - tests::epoch_22::disable_pox |
136 |
| - - tests::epoch_22::test_pox_reorg_one_flap |
137 |
| - - tests::epoch_23::trait_invocation_behavior |
138 |
| - - tests::neon_integrations::bad_microblock_pubkey |
139 |
| - - tests::epoch_24::fix_to_pox_contract |
140 |
| - - tests::epoch_24::verify_auto_unlock_behavior |
| 76 | + - tests::neon_integrations::test_problematic_txs_are_not_stored |
| 77 | + - tests::neon_integrations::use_latest_tip_integration_test |
| 78 | + - tests::should_succeed_handling_malformed_and_valid_txs |
141 | 79 | steps:
|
142 |
| - - name: Checkout the latest code |
143 |
| - id: git_checkout |
144 |
| - uses: actions/checkout@v3 |
145 |
| - - name: Download docker image |
146 |
| - id: download_docker_image |
147 |
| - uses: actions/download-artifact@v3 |
148 |
| - with: |
149 |
| - name: integration-image.tar.gz |
150 |
| - - name: Load docker image |
151 |
| - id: load_docker_image |
152 |
| - run: docker load -i integration-image.tar.gz && rm integration-image.tar.gz |
153 |
| - - name: All integration tests with sampled genesis |
154 |
| - id: bitcoin_integration_tests |
155 |
| - timeout-minutes: 30 |
156 |
| - env: |
157 |
| - DOCKER_BUILDKIT: 1 |
158 |
| - TEST_NAME: ${{ matrix.test-name }} |
159 |
| - run: docker build -o coverage-output --build-arg test_name=${{ matrix.test-name }} -f ./.github/actions/bitcoin-int-tests/Dockerfile.bitcoin-tests . |
160 |
| - - name: Code Coverage |
161 |
| - id: code_coverage |
162 |
| - uses: codecov/codecov-action@v3 |
163 |
| - with: |
164 |
| - files: ./coverage-output/lcov.info |
165 |
| - name: ${{ matrix.test-name }} |
166 |
| - fail_ci_if_error: false |
| 80 | + ## Setup test environment |
| 81 | + - name: Setup Test Environment |
| 82 | + id: setup_tests |
| 83 | + uses: stacks-network/actions/stacks-core/testenv@main |
167 | 84 |
|
168 |
| - # Run atlas integration tests |
169 |
| - atlas-test: |
170 |
| - name: Atlas Test |
171 |
| - runs-on: ubuntu-latest |
172 |
| - needs: |
173 |
| - - build-integration-image |
174 |
| - strategy: |
175 |
| - fail-fast: false |
176 |
| - matrix: |
177 |
| - test-name: |
178 |
| - - tests::neon_integrations::atlas_integration_test |
179 |
| - - tests::neon_integrations::atlas_stress_integration_test |
180 |
| - steps: |
181 |
| - - name: Checkout the latest code |
182 |
| - id: git_checkout |
183 |
| - uses: actions/checkout@v3 |
184 |
| - - name: Download docker image |
185 |
| - id: download_docker_image |
186 |
| - uses: actions/download-artifact@v3 |
| 85 | + ## Run test matrix using restored cache of archive file |
| 86 | + ## - Test will timeout after env.TEST_TIMEOUT minutes |
| 87 | + - name: Run Tests |
| 88 | + id: run_tests |
| 89 | + timeout-minutes: ${{ fromJSON(env.TEST_TIMEOUT) }} |
| 90 | + uses: stacks-network/actions/stacks-core/run-tests@main |
187 | 91 | with:
|
188 |
| - name: integration-image.tar.gz |
189 |
| - - name: Load docker image |
190 |
| - id: load_docker_image |
191 |
| - run: docker load -i integration-image.tar.gz && rm integration-image.tar.gz |
192 |
| - - name: Atlas integration tests |
193 |
| - id: atlas_integration_tests |
194 |
| - timeout-minutes: 40 |
195 |
| - env: |
196 |
| - DOCKER_BUILDKIT: 1 |
197 |
| - TEST_NAME: ${{ matrix.test-name }} |
198 |
| - run: docker build -o coverage-output --build-arg test_name=${{ matrix.test-name }} -f ./.github/actions/bitcoin-int-tests/Dockerfile.bitcoin-tests . |
| 92 | + test-name: ${{ matrix.test-name }} |
| 93 | + threads: 1 |
| 94 | + |
| 95 | + ## Create and upload code coverage file |
199 | 96 | - name: Code Coverage
|
200 |
| - id: code_coverage |
201 |
| - uses: codecov/codecov-action@v3 |
| 97 | + id: codecov |
| 98 | + uses: stacks-network/actions/codecov@main |
202 | 99 | with:
|
203 |
| - files: ./coverage-output/lcov.info |
204 |
| - name: ${{ matrix.test-name }} |
205 |
| - fail_ci_if_error: false |
| 100 | + test-name: ${{ matrix.test-name }} |
0 commit comments