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

Create e2e tests for the Aztec CLI #1448

Closed
spalladino opened this issue Aug 7, 2023 · 2 comments
Closed

Create e2e tests for the Aztec CLI #1448

spalladino opened this issue Aug 7, 2023 · 2 comments
Labels
T-testing Type: Testing. More tests need to be added.

Comments

@spalladino
Copy link
Collaborator

We have a few options on how to call the CLI from an e2e test suite:

  1. Go through the shell. Use child_process.exec to call the CLI directly through the shell in the context of a jest test suite and parse the output. It's as e2endy as you can get, but cumbersome (and brittle) due to the parsing.
  2. Get an instance of the configured program from commander and manually call program.parse with whatever arguments we want. We'd be running the CLI on the same process as the tests (which is probably faster? or at least removes the inconveniences of having to locate the CLI binary), but we'd still have the same issues with parsing output.
  3. Split out the CLI logic, so yarn-project/aztec-cli/src/index.ts only declares the commands, and we keep separate functions with the actual logic that map 1:1 to each command. These functions can return stuff (instead of or in addition to) logging it, and we test these functions.

After discussing with @PhilWindle we're leaning towards option 2.

@spalladino spalladino added this to A3 Aug 7, 2023
@github-project-automation github-project-automation bot moved this to Todo in A3 Aug 7, 2023
@iAmMichaelConnor
Copy link
Contributor

Possible duplicate of #1450?

@iAmMichaelConnor iAmMichaelConnor added the T-testing Type: Testing. More tests need to be added. label Aug 25, 2023
@spalladino
Copy link
Collaborator Author

Certainly!

@spalladino spalladino closed this as not planned Won't fix, can't repro, duplicate, stale Aug 25, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in A3 Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-testing Type: Testing. More tests need to be added.
Projects
Archived in project
Development

No branches or pull requests

2 participants