discovery-docker-network icon indicating copy to clipboard operation
discovery-docker-network copied to clipboard

List of Integration Tests

Open lacabra opened this issue 6 years ago • 4 comments
trafficstars

Sunny Days ☀️

    • [x] Test: Network Initialization
    • [x] Test: userWorkerKey exchange
    • [x] Automatic epoch transitions (aka Pass The Torch -> PTT)
    • [x] Test: Successful deployment of contract_1: calculator
    • [x] Test: Successful compute of contract_1: calculator
    • [x] Test: Successful deployment of contract_2: flipcoin
    • [x] Test: Successful compute of contract_2: flipcoin
    • [x] Test: Successful deployment of contract_3: erc20
    • [x] Test: Successful compute of contract_3: erc20
    • [x] Test: Successful deployment of contract_4: millionaires
    • [x] Test: Successful compute of contract_4: millionaires
    • [x] Test Successful deployment of contract_5: Voting
    • [x] Test Successful compute of contract_5: Voting with Ethereum call
    • [x] Successful simultaneous deployments of contracts 1, 2, 3, 4 & 5
    • [x] Test: Successful successive computations with no state change (contract_1: simple_calculator)
    • [x] Successful successive computations that change the state across epochs
    • [x] Successful multiple computations across multiple workers and epochs

Rainy Days 🌧

    • [x] Test: Failed contract deployment: wrong bytecode
    • [x] Test Failed contract deployment: wrong encryption key
    • [x] Test: Failed contract deployment: wrong worker
    • [ ] Test: Failed contract deployment: wrong constructor function (enigmampc/enigma-core#111)
    • [x] Test: Failed contract deployment: wrong constructor arguments (enigmampc/enigma-core#128)
    • [x] Test: Failed contract deployment: out of gas
    • [x] Test: Failed execution: wrong parameters (enigmampc/enigma-core#128)
    • [x] Test: Failed execution: out of gas
    • [ ] Test: Failed execution: non-existent secret contract address (#10)
    • [x] Test Failed execution: wrong encryption key
    • [x] Test Failed execution: wrong worker
    • [ ] Failed execution: runtime exception (similar to enigmampc/enigma-core#128)
    • [x] Failed execution: wrong Ethereum payload
    • [x] Failed execution: wrong Ethereum address

lacabra avatar Apr 08 '19 20:04 lacabra

@lacabra We propose the following test categories for sunny day scenarios (the tests which are covered, we tried to mark):

  • 1 contract deployment - 1 worker, 1 user, 1 epoch. (covered by tests: 4-14- only even numbers) - 1 worker, 1 user, change of an epoch.

  • 1 contract deployment + 1 computation - 1 worker, 1 user, 1 epoch. (covered by tests: 4-15) - 1 worker, 1 user, change of an epoch.

  • 2 contract deployments, 3 computations, change of epochs. - 1 worker, 1 user. - 3 workers, 1 user (covered by test 16?). - 3 workers, 2 users. - 1 worker, 1 user, 1 no state change, 1 state change. (covered by tests: 17-18)

AvishaiW avatar May 02 '19 12:05 AvishaiW

That's fine. For the ones that require a change of epoch, we can combine some of the ones we already have with the advance_epoch, so I don't think they require any additional work, but rather concatenating existing tests.

For those that involve more workers, again we can reuse existing tests and launch the network with NODES=3, so again it doesn't sound like we need new tests, but rather combining the existing tests with the right parameters.

lacabra avatar May 02 '19 14:05 lacabra

In our effort of expanding the integration test suite until we have a full functional system test environment, here is an initial suggestion for the next steps.

Current status:

  • The CI of each of the repositories, thanks to @lacabra's hard work, includes now most (all?) of the test cases 1-33 run with 1 worker + 1 user. Epoch changes happen automatically in the duration of the run as a result of the short epoch period (?)

Proposed next steps:

  1. Run the current test suite with more workers (3, 5, 9) and users (1, 3, 5) periodically (by attaching to a CI framework / simple cron job running once a day).

  2. Add more test cases/combine the existing tests to test the following:

  • Deployment of (5, 10) contracts + (15, 20) computations, one after the other
    • Triggered by (1, 2) user, (1, 5) workers in the network
    • Triggered by 5 user, 10 workers in the network
      • All workers are online during the entire scenario run
      • 5 of the workers come online in the middle of the scenario (others always online)
      • 5 of the workers go offline in the middle of the scenario (others always online)
  • Simultaneous task creations
    • Deployment of 5 contracts + 15 computations, triggered by (3, 5) users, (5, 10) workers

Will love to hear your feedback @lacabra @AvishaiW @moriaab

lenak25 avatar Jul 30 '19 14:07 lenak25

@lenak25 @mdemri @Cashmaney @AvishaiW (cc @lacabra) This is an initial set of the network events to test in system tests that we agreed upon (maybe some of the events may be tested in integration tests as well):

  • enigma contract upgrade
  • worker upgrade
  • worker added/removed (important to know how to kill the worker executing the computation)
  • worker up/down; kinds of down:
    • does not succeed to compute and/or publish
    • does not succeed to get updates from outside
  • upgrade of KM node
  • KM node down/up (redundancy)
  • bootstrup nodes up/down

moriaab avatar Oct 15 '19 10:10 moriaab