diff --git a/.circleci/config.yml b/.circleci/config.yml index f00c29e036..7a6e3b4b62 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -124,14 +124,13 @@ commands: - run: name: Run ffi cucumber scenarios command: cd integration_tests && mkdir -p cucumber_output && node_modules/.bin/cucumber-js --tags "not @long-running and not @broken and not @flaky and @wallet-ffi" --format json:cucumber_output/tests-ffi.cucumber - - run: - name: Generate report (ff) - command: cd integration_tests && node ./generate_report.js cucumber_output/tests-ffi.cucumber temp/reports/cucumber_ffi_report.html + name: Generate report (ffi) + command: cd integration_tests && touch cucumber_output/tests-ffi.cucumber && node ./generate_report.js cucumber_output/tests-ffi.cucumber temp/reports/cucumber_ffi_report.html when: always -# - run: -# name: Run flaky/broken cucumber scenarios (Always pass) -# command: cd integration_tests && node_modules/.bin/cucumber-js --tags "not @long-running and (@broken or @flaky)" --format json:cucumber_output/broken-tests.cucumber || true + # - run: + # name: Run flaky/broken cucumber scenarios (Always pass) + # command: cd integration_tests && node_modules/.bin/cucumber-js --tags "not @long-running and (@broken or @flaky)" --format json:cucumber_output/broken-tests.cucumber || true - store_test_results: path: integration_tests/cucumber_output - store_artifacts: diff --git a/integration_tests/features/BaseNodeConnectivity.feature b/integration_tests/features/BaseNodeConnectivity.feature index a8cebb84f4..2ef4fd6597 100644 --- a/integration_tests/features/BaseNodeConnectivity.feature +++ b/integration_tests/features/BaseNodeConnectivity.feature @@ -14,3 +14,9 @@ Feature: Base Node Connectivity Then I wait for WALLET_A to have 1 node connections Then I wait for WALLET_A to have ONLINE connectivity Then SEED_A is connected to WALLET_A + + Scenario: Base node lists headers + Given I have 1 seed nodes + And I have a base node BN1 connected to all seed nodes + When I mine 5 blocks on BN1 + Then node BN1 lists headers 1 to 5 with correct heights \ No newline at end of file diff --git a/integration_tests/features/support/steps.js b/integration_tests/features/support/steps.js index 09cac2d4bc..b3a70ae85a 100644 --- a/integration_tests/features/support/steps.js +++ b/integration_tests/features/support/steps.js @@ -1088,6 +1088,20 @@ Then(/node (.*) is at tip (.*)/, async function (node, name) { ); }); +Then( + /node (.*) lists headers (\d+) to (\d+) with correct heights/, + async function (node, start, end) { + const client = this.getClient(node); + const fromHeight = end; + const numHeaders = end - start + 1; // inclusive + const headers = await client.getHeaders(fromHeight, numHeaders); + const heights = headers.map((header) => parseInt(header.height)); + for (let height = start; height <= end; height++) { + expect(heights).to.contain(height); + } + } +); + When( /I mine a block on (.*) with coinbase (.*)/, { timeout: 600 * 1000 }, diff --git a/integration_tests/helpers/baseNodeClient.js b/integration_tests/helpers/baseNodeClient.js index 761ddf5359..5ee2db67d6 100644 --- a/integration_tests/helpers/baseNodeClient.js +++ b/integration_tests/helpers/baseNodeClient.js @@ -77,6 +77,12 @@ class BaseNodeClient { }); } + async getHeaders(from_height, num_headers, sorting = 0) { + return await this.client + .listHeaders() + .sendMessage({ from_height, num_headers, sorting }); + } + getTipHeight() { return this.client .getTipInfo()