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: multinode integration test refactor #662

Merged
merged 11 commits into from
Feb 19, 2024

Conversation

emizzle
Copy link
Contributor

@emizzle emizzle commented Dec 20, 2023

Closes #594

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.

Copy link
Member

@markspanbroek markspanbroek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great refactor, thanks @emizzle! I left a few small comments, but overall good to go!

@emizzle emizzle force-pushed the refactor/integration/multi-node-integration-tests branch from b10b62e to eeead89 Compare January 9, 2024 05:36
@emizzle emizzle force-pushed the refactor/integration/multi-node-integration-tests branch from eeead89 to 2493357 Compare January 22, 2024 03:13
Copy link
Contributor

@dryajov dryajov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be good to merge, but the windows integration tests are failing for some reason, other than that 👍

Copy link
Contributor

@dryajov dryajov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@dryajov dryajov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@emizzle emizzle force-pushed the refactor/integration/multi-node-integration-tests branch 2 times, most recently from e3b505a to 9d7b0dd Compare February 16, 2024 11:06
@dryajov dryajov enabled auto-merge February 16, 2024 22:05
@dryajov dryajov disabled auto-merge February 16, 2024 22:11
@dryajov dryajov enabled auto-merge February 16, 2024 22:37
emizzle and others added 10 commits February 16, 2024 16:47
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.
- 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 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.
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.
@dryajov dryajov force-pushed the refactor/integration/multi-node-integration-tests branch from 5ce32c9 to 555d2a7 Compare February 16, 2024 22:48
@dryajov dryajov disabled auto-merge February 16, 2024 22:54
@dryajov dryajov enabled auto-merge February 16, 2024 23:01
@dryajov dryajov added this pull request to the merge queue Feb 16, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 16, 2024
@dryajov dryajov added this pull request to the merge queue Feb 17, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 17, 2024
@emizzle emizzle added this pull request to the merge queue Feb 19, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 19, 2024
@emizzle emizzle added this pull request to the merge queue Feb 19, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 19, 2024
@emizzle emizzle added this pull request to the merge queue Feb 19, 2024
Merged via the queue into master with commit d70ab59 Feb 19, 2024
10 checks passed
@emizzle emizzle deleted the refactor/integration/multi-node-integration-tests branch February 19, 2024 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose Slot's state over API
3 participants