2024-02-06 10:56:27 +00:00
|
|
|
name: Reusable - CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
matrix:
|
|
|
|
type: string
|
|
|
|
cache_nonce:
|
|
|
|
default: '0'
|
|
|
|
description: Allows for easily busting actions/cache caches
|
|
|
|
required: false
|
|
|
|
type: string
|
|
|
|
|
|
|
|
env:
|
|
|
|
cache_nonce: ${{ inputs.cache_nonce }}
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include: ${{ fromJson(inputs.matrix) }}
|
|
|
|
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: ${{ matrix.shell }} {0}
|
|
|
|
|
2024-11-22 12:05:00 +00:00
|
|
|
name: ${{ matrix.os }}-${{ matrix.tests }}-${{ matrix.cpu }}-${{ matrix.nim_version }}
|
2024-02-06 10:56:27 +00:00
|
|
|
runs-on: ${{ matrix.builder }}
|
2024-11-25 11:23:04 +00:00
|
|
|
timeout-minutes: 120
|
2024-02-06 10:56:27 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
2024-06-13 01:54:50 +00:00
|
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
2024-02-06 10:56:27 +00:00
|
|
|
|
|
|
|
- name: Setup Nimbus Build System
|
|
|
|
uses: ./.github/actions/nimbus-build-system
|
|
|
|
with:
|
|
|
|
os: ${{ matrix.os }}
|
|
|
|
shell: ${{ matrix.shell }}
|
|
|
|
nim_version: ${{ matrix.nim_version }}
|
|
|
|
|
|
|
|
## Part 1 Tests ##
|
|
|
|
- name: Unit tests
|
|
|
|
if: matrix.tests == 'unittest' || matrix.tests == 'all'
|
|
|
|
run: make -j${ncpu} test
|
|
|
|
|
|
|
|
# workaround for https://github.com/NomicFoundation/hardhat/issues/3877
|
|
|
|
- name: Setup Node.js
|
|
|
|
uses: actions/setup-node@v4
|
|
|
|
with:
|
|
|
|
node-version: 18.15
|
|
|
|
|
|
|
|
- name: Start Ethereum node with Codex contracts
|
2024-09-23 14:37:17 +00:00
|
|
|
if: matrix.tests == 'contract' || matrix.tests == 'integration' || matrix.tests == 'tools' || matrix.tests == 'all'
|
2024-02-06 10:56:27 +00:00
|
|
|
working-directory: vendor/codex-contracts-eth
|
|
|
|
env:
|
|
|
|
MSYS2_PATH_TYPE: inherit
|
|
|
|
run: |
|
|
|
|
npm install
|
|
|
|
npm start &
|
|
|
|
|
|
|
|
## Part 2 Tests ##
|
|
|
|
- name: Contract tests
|
|
|
|
if: matrix.tests == 'contract' || matrix.tests == 'all'
|
|
|
|
run: make -j${ncpu} testContracts
|
|
|
|
|
|
|
|
## Part 3 Tests ##
|
|
|
|
- name: Integration tests
|
|
|
|
if: matrix.tests == 'integration' || matrix.tests == 'all'
|
|
|
|
run: make -j${ncpu} testIntegration
|
|
|
|
|
refactor: multinode integration test refactor (#662)
* refactor multi node test suite
Refactor the multinode test suite into the marketplace test suite.
- Arbitrary number of nodes can be started with each test: clients, providers, validators
- Hardhat can also be started locally with each test, usually for the purpose of saving and inspecting its log file.
- Log files for all nodes can be persisted on disk, with configuration at the test-level
- Log files, if persisted (as specified in the test), will be persisted to a CI artifact
- Node config is specified at the test-level instead of the suite-level
- Node/Hardhat process starting/stopping is now async, and runs much faster
- Per-node config includes:
- simulating proof failures
- logging to file
- log level
- log topics
- storage quota
- debug (print logs to stdout)
- Tests find next available ports when starting nodes, as closing ports on Windows can lag
- Hardhat is no longer required to be running prior to starting the integration tests (as long as Hardhat is configured to run in the tests).
- If Hardhat is already running, a snapshot will be taken and reverted before and after each test, respectively.
- If Hardhat is not already running and configured to run at the test-level, a Hardhat process will be spawned and torn down before and after each test, respectively.
* additional logging for debug purposes
* address PR feedback
- fix spelling
- revert change from catching ProviderError to SignerError -- this should be handled more consistently in the Market abstraction, and will be handled in another PR.
- remove method label from raiseAssert
- remove unused import
* Use API instead of command exec to test for free port
Use chronos `createStreamServer` API to test for free port by binding localhost address and port. Use `ServerFlags.ReuseAddr` to enable reuse of same IP/Port on multiple test runs.
* clean up
* remove upraises annotations from tests
* Update tests to work with updated erasure coding slot sizes
* update dataset size, nodes, tolerance to match valid ec params
Integration tests now have valid dataset sizes (blocks), tolerances, and number of nodes, to work with valid ec params. These values are validated when requested storage.
Print the rest api failure message (via doAssert) when a rest api call fails (eg the rest api may validate some ec params).
All integration tests pass when the async `clock.now` changes are reverted.
* dont use async clock for now
* fix workflow
* move integration logs uplod to reusable
---------
Co-authored-by: Dmitriy Ryajov <dryajov@gmail.com>
2024-02-19 04:55:39 +00:00
|
|
|
- name: Upload integration tests log files
|
2024-02-19 18:55:49 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
if: (matrix.tests == 'integration' || matrix.tests == 'all') && always()
|
refactor: multinode integration test refactor (#662)
* refactor multi node test suite
Refactor the multinode test suite into the marketplace test suite.
- Arbitrary number of nodes can be started with each test: clients, providers, validators
- Hardhat can also be started locally with each test, usually for the purpose of saving and inspecting its log file.
- Log files for all nodes can be persisted on disk, with configuration at the test-level
- Log files, if persisted (as specified in the test), will be persisted to a CI artifact
- Node config is specified at the test-level instead of the suite-level
- Node/Hardhat process starting/stopping is now async, and runs much faster
- Per-node config includes:
- simulating proof failures
- logging to file
- log level
- log topics
- storage quota
- debug (print logs to stdout)
- Tests find next available ports when starting nodes, as closing ports on Windows can lag
- Hardhat is no longer required to be running prior to starting the integration tests (as long as Hardhat is configured to run in the tests).
- If Hardhat is already running, a snapshot will be taken and reverted before and after each test, respectively.
- If Hardhat is not already running and configured to run at the test-level, a Hardhat process will be spawned and torn down before and after each test, respectively.
* additional logging for debug purposes
* address PR feedback
- fix spelling
- revert change from catching ProviderError to SignerError -- this should be handled more consistently in the Market abstraction, and will be handled in another PR.
- remove method label from raiseAssert
- remove unused import
* Use API instead of command exec to test for free port
Use chronos `createStreamServer` API to test for free port by binding localhost address and port. Use `ServerFlags.ReuseAddr` to enable reuse of same IP/Port on multiple test runs.
* clean up
* remove upraises annotations from tests
* Update tests to work with updated erasure coding slot sizes
* update dataset size, nodes, tolerance to match valid ec params
Integration tests now have valid dataset sizes (blocks), tolerances, and number of nodes, to work with valid ec params. These values are validated when requested storage.
Print the rest api failure message (via doAssert) when a rest api call fails (eg the rest api may validate some ec params).
All integration tests pass when the async `clock.now` changes are reverted.
* dont use async clock for now
* fix workflow
* move integration logs uplod to reusable
---------
Co-authored-by: Dmitriy Ryajov <dryajov@gmail.com>
2024-02-19 04:55:39 +00:00
|
|
|
with:
|
2024-02-19 18:55:49 +00:00
|
|
|
name: ${{ matrix.os }}-${{ matrix.cpu }}-${{ matrix.nim_version }}-integration-tests-logs
|
refactor: multinode integration test refactor (#662)
* refactor multi node test suite
Refactor the multinode test suite into the marketplace test suite.
- Arbitrary number of nodes can be started with each test: clients, providers, validators
- Hardhat can also be started locally with each test, usually for the purpose of saving and inspecting its log file.
- Log files for all nodes can be persisted on disk, with configuration at the test-level
- Log files, if persisted (as specified in the test), will be persisted to a CI artifact
- Node config is specified at the test-level instead of the suite-level
- Node/Hardhat process starting/stopping is now async, and runs much faster
- Per-node config includes:
- simulating proof failures
- logging to file
- log level
- log topics
- storage quota
- debug (print logs to stdout)
- Tests find next available ports when starting nodes, as closing ports on Windows can lag
- Hardhat is no longer required to be running prior to starting the integration tests (as long as Hardhat is configured to run in the tests).
- If Hardhat is already running, a snapshot will be taken and reverted before and after each test, respectively.
- If Hardhat is not already running and configured to run at the test-level, a Hardhat process will be spawned and torn down before and after each test, respectively.
* additional logging for debug purposes
* address PR feedback
- fix spelling
- revert change from catching ProviderError to SignerError -- this should be handled more consistently in the Market abstraction, and will be handled in another PR.
- remove method label from raiseAssert
- remove unused import
* Use API instead of command exec to test for free port
Use chronos `createStreamServer` API to test for free port by binding localhost address and port. Use `ServerFlags.ReuseAddr` to enable reuse of same IP/Port on multiple test runs.
* clean up
* remove upraises annotations from tests
* Update tests to work with updated erasure coding slot sizes
* update dataset size, nodes, tolerance to match valid ec params
Integration tests now have valid dataset sizes (blocks), tolerances, and number of nodes, to work with valid ec params. These values are validated when requested storage.
Print the rest api failure message (via doAssert) when a rest api call fails (eg the rest api may validate some ec params).
All integration tests pass when the async `clock.now` changes are reverted.
* dont use async clock for now
* fix workflow
* move integration logs uplod to reusable
---------
Co-authored-by: Dmitriy Ryajov <dryajov@gmail.com>
2024-02-19 04:55:39 +00:00
|
|
|
path: tests/integration/logs/
|
|
|
|
retention-days: 1
|
|
|
|
|
2024-09-23 14:37:17 +00:00
|
|
|
## Part 4 Tools ##
|
|
|
|
- name: Tools tests
|
|
|
|
if: matrix.tests == 'tools' || matrix.tests == 'all'
|
|
|
|
run: make -j${ncpu} testTools
|
|
|
|
|
2024-02-06 10:56:27 +00:00
|
|
|
status:
|
|
|
|
if: always()
|
|
|
|
needs: [build]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }}
|
|
|
|
run: exit 1
|