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

End-to-end integration tests for Zeekoe #69

Open
plaidfinch opened this issue Jun 16, 2021 · 2 comments
Open

End-to-end integration tests for Zeekoe #69

plaidfinch opened this issue Jun 16, 2021 · 2 comments
Assignees
Labels

Comments

@plaidfinch
Copy link
Contributor

plaidfinch commented Jun 16, 2021

The goal is to develop a script for end-to-end testing zkChannels lifecycle (ie establish, pay, and close) on

  • sandbox
  • testnet
  • mainnet

Update 1/10/22: The current version of the test script executes many code paths, but it does not effectively compare them to the expected outcomes. In particular, it does not distinguish "happy paths" from test cases that should fail, and it does not react to non-abortive failures in the chain watchers (#338).

I propose an updating testing framework in Rust that uses the standard test conventions (e.g. lives in test/) and solves these issues. Like the existing script, it would

  • have to run in an environment with an accessible on-chain network
  • spin up and monitor a merchant server, customer watcher as sub-processes (or, depending on Write spec for RPC Protocol #322, using an RPC request).

Each test is described as a struct with a list of pairs of an operation (e.g. establish, pay, pay all, expiry) and an expected outcome (customer status, merchant status, whether an error should be raised).

The tests will run the setup phase once, then run each test. Every test needs to monitor the output from the three processes (server, watcher, and operation) and identify errors relevant to itself; this may become easier with #91. It will also check the expected outcome against the current status (e.g. by calling list for each party).

The tests cannot be run in parallel with the current Tezos instantiation per #282, #212. We can prevent this with a testing flag. If we do eventually parallelize testing, we will need to define a way for the test to identify errors that belong to itself, as the server and watcher may be generating errors for multiple tests in parallel.

Ideally, this will confer the following benefits:

  • greater nuance in determining whether the correct error was thrown (e.g. by the correct party? at the correct step in the set of operations?)
  • more easily extended to a chain-agnostic environment (and to testing on-chain error cases), since we could build a mocked un-networked testing chain fully in Rust after we define a chain trait Create chain-agnostic ArbiterClient trait #346
  • easier to scan test coverage: they can be named and explicitly defined using a consistent format
  • easier to build out malicious party scenarios Test malicious-customer pay scenarios #327: we could switch out the honest party sub-process for a mocked malicious party and define the specific expected error cases
@indomitableSwan
Copy link

@jakinyele what is the current status of this? Are we moving this to milestone 4?

@jakinyele
Copy link
Member

jakinyele commented Sep 9, 2021

Correct, we won't have any automated scripts to support end-to-end tests until milestone 4. Will create a new issue for testing goal specifically for milestone 3.

marsella added a commit that referenced this issue Jan 19, 2022
- adds a simple test to write out the test config and sanity check
- updates CI to run integration tests at night only
marsella added a commit that referenced this issue Jan 24, 2022
This is to make #69 more possible. Moves all the logic except the basic
match on the CLI into a module called zkchannels

Fixes all the imports, etc.
marsella added a commit that referenced this issue Jan 25, 2022
adds a subscriber that writes to file
adds some dummy tasks to test that read/writing errors works
marsella added a commit that referenced this issue Jan 27, 2022
marsella added a commit that referenced this issue Jan 28, 2022
moves content to integration-tests instead of standard tests
adds a subscriber that writes to file
add basic spawns and error logging in tests #69
adds some dummy tasks to test that read/writing errors works
marsella added a commit that referenced this issue Jan 28, 2022
marsella added a commit that referenced this issue Jan 28, 2022
- adds types to describe test and expected outcome
- fixes execution infra to run tests correctly
- fixes verification iteration
- adds establish execution
- adds a bunch more setup infra
marsella added a commit that referenced this issue Feb 1, 2022
This makes sense for the content-request commands, like Show and List
that return a meaningful value
marsella added a commit that referenced this issue Feb 1, 2022
- updates merchant `Show` and `List` commands to return a string
- to do so, adds output type to merchant `Command`
- adds PublicChannelDetails for merchant database
- runs Show command for merchant and compares to expected output
marsella added a commit that referenced this issue Feb 4, 2022
- adds inline generation of self-signed SSL certs
- checks outcome of active operation against expected
- adds error types for active op mismatches
marsella added a commit that referenced this issue Feb 4, 2022
- moves and merges server behavior with active operation behavior
- documents assumptions more explicitly
- adds test for non-shared name in establish
marsella added a commit that referenced this issue Feb 22, 2022
Makes the JSON representation consistent with Show. Also updates
documentation with the difference between JSON and not.
marsella added a commit that referenced this issue Feb 22, 2022
marsella added a commit that referenced this issue Feb 22, 2022
marsella added a commit that referenced this issue Mar 7, 2022
marsella added a commit that referenced this issue Mar 14, 2022
This is a 55-commit squash, mostly debug messages. Steps along the way include:
- update Dockerfile to pull the correct branch
- make sure the blockchain level is appropriate
- add dynamic configuration of sandbox URI
- separate tests into a configurable Dockerfile, put original image on ghcr
- use correct version of pytezos
- optimize performance by setting up sandbox before building
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants