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

Implement first E2E test in Haskell #4931

Closed
Tracked by #4852
abailly opened this issue Jan 10, 2025 · 4 comments
Closed
Tracked by #4852

Implement first E2E test in Haskell #4931

abailly opened this issue Jan 10, 2025 · 4 comments
Assignees

Comments

@abailly
Copy link
Collaborator

abailly commented Jan 10, 2025

  • Investigate whether to reuse or ditch existing E2E framework from Yura
  • Investigate reuse of integration tests to run against preprod (or any network)
  • Implement a first E2E test running against preprod using existing keys/wallets
  • Integrate E2E test run in CI
@abailly
Copy link
Collaborator Author

abailly commented Jan 10, 2025

This is needed for #4852

@abailly
Copy link
Collaborator Author

abailly commented Jan 13, 2025

I wonder if there aren't already tools we could leverage in the Cardano Haskell ecosystem.

@Anviking Anviking self-assigned this Jan 13, 2025
@Anviking
Copy link
Member

Creating a preprod Context for cardano-wallet-integration looked to be fairly straight-forward to me. wallet-e2e looks kind of cool though (+ already seems to support both local testnet and preprod). I wonder if one could translate between the two somehow, for potential incremental migration…

Not sure what kind of other tool in the ecosystem we could use. Found https://github.com/IntersectMBO/antaeus but appears to not support preprod and to be focused on Haskell APIs.

github-merge-queue bot pushed a commit that referenced this issue Jan 15, 2025
Ensure we can run:

```bash
just e2e-preprod          (10s 383ms)
nix shell '.#cardano-node' '.#cardano-wallet' '.#cardano-wallet-e2e' -c wallet-e2e preprod -s lib/wallet-e2e/test-state/preprod -c lib/wallet-e2e/config/cardano-node/preprod -t lib/wallet-e2e/test-output/preprod
Writing node logs to /Users/anviking/IOHK/cardano-wallet/lib/wallet-e2e/test-state/preprod/node/node.log
Tests:

Wallet Backend API
Writing wallet logs to /Users/anviking/IOHK/cardano-wallet/lib/wallet-e2e/test-state/preprod/wallet/wallet.log
Node sync progress: 100.0%
Node status as reported by wallet: ready
  ✓ Created wallet is listed                                             336.02 ms
  ✓ Created wallet can be retrieved by id                                220.81 ms
  ✓ Created wallet has zero ADA balance                                  253.46 ms
Effect interpreters
  Timeouts
    ✓ no timeout                                                         901.68 ms
    ✓ timeout in 10 milliseconds                                        1002.10 ms

  Passed:                       5
  Failed:                       0
  Sum of test runtimes:         2.71 seconds
  Test suite took:             58.47 seconds
```

#4931
github-merge-queue bot pushed a commit that referenced this issue Feb 6, 2025
)

- [x] Add a new `cardano-wallet-integration:e2e` test suite that:
- has, and intends to have, a minimal number of tests. It does not want
to duplicate everything from `cardano-wallet-integration`.
- mostly uses the same `Test.Integration.Framework.DSL` the integration
tests are written in
- is replacing `lib/wallet-e2e` and is intended to soon replace the ruby
e2e tests
- [x] Run this `cardano-wallet-integration:e2e` in CI on windows
- [new run which hopefully passes like the prev
one](https://buildkite.com/cardano-foundation/cardano-wallet/builds/9261#0194d089-3ef3-4f12-85ac-ad68f5a5f0b7)
and should now make the stages of the setup appear as sections in the
buildkite logs
- [x] No longer run ruby e2e tests on win

### Global preprod setup

We use only two wallets that are funded with ada. The transaction test
will send funds from the richer to the poorer wallet. This should reduce
the need for manual involvement as the funds last longer, and in a pinch
we could even get by funding just one of the test wallets.

### How to run

```bash
export HAL_E2E_PREPROD_MNEMONICS='<mnemonics be found in our vault>'
cabal test cardano-wallet-integration:e2e
```

With node and wallet stdout logs manually cleaned:

```bash
transactions
  simple transaction (TRANS_CREATE_01x) [✔]
stake pools
  list
    some have non-zero rewards, stake, producedBlocks, saturation [✔]
    some have metadata [‐]
      # PENDING: metadata fetching not configured; could be enabled
```

### Issue Number

#4931
github-merge-queue bot pushed a commit that referenced this issue Feb 6, 2025
)

- [x] Add a new `cardano-wallet-integration:e2e` test suite that:
- has, and intends to have, a minimal number of tests. It does not want
to duplicate everything from `cardano-wallet-integration`.
- mostly uses the same `Test.Integration.Framework.DSL` the integration
tests are written in
- is replacing `lib/wallet-e2e` and is intended to soon replace the ruby
e2e tests
- [x] Run this `cardano-wallet-integration:e2e` in CI on windows
- [new run which hopefully passes like the prev
one](https://buildkite.com/cardano-foundation/cardano-wallet/builds/9261#0194d089-3ef3-4f12-85ac-ad68f5a5f0b7)
and should now make the stages of the setup appear as sections in the
buildkite logs
- [x] No longer run ruby e2e tests on win

### Global preprod setup

We use only two wallets that are funded with ada. The transaction test
will send funds from the richer to the poorer wallet. This should reduce
the need for manual involvement as the funds last longer, and in a pinch
we could even get by funding just one of the test wallets.

### How to run

```bash
export HAL_E2E_PREPROD_MNEMONICS='<mnemonics be found in our vault>'
cabal test cardano-wallet-integration:e2e
```

With node and wallet stdout logs manually cleaned:

```bash
transactions
  simple transaction (TRANS_CREATE_01x) [✔]
stake pools
  list
    some have non-zero rewards, stake, producedBlocks, saturation [✔]
    some have metadata [‐]
      # PENDING: metadata fetching not configured; could be enabled
```

### Issue Number

#4931
@Anviking
Copy link
Member

Anviking commented Feb 7, 2025

Done with #4949

@Anviking Anviking closed this as completed Feb 7, 2025
github-merge-queue bot pushed a commit that referenced this issue Feb 12, 2025
- [x] Embed mithril bootstrapping into the haskell e2e setup
    - [x] See it working locally
    - [x] See it working in ci on windows
    - Add mac and linux ci steps => for next PR
- [x] Add HAL_E2E_ALREADY_RUNNING_WALLET_PORT option
- As per default `cardano-wallet-integration-e2e` now bootstraps in a
fresh tmp directory using mithril, it's good to have a way to iterate
faster locally.
- Coincidentally, this makes stdout clean per default, without the need
for some `--silent` flag

### Issue Number

<s>#4931</s> #4977
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

No branches or pull requests

2 participants