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

Add our tests to CI pipeline 🧪 #273

Closed
camelPhonso opened this issue Jun 29, 2024 · 5 comments
Closed

Add our tests to CI pipeline 🧪 #273

camelPhonso opened this issue Jun 29, 2024 · 5 comments
Assignees

Comments

@camelPhonso
Copy link
Contributor

Expected Behavior

With Storybook now in our stack with component tests via the jest extension, plus the End-to-end testing via Cypress suites, we should run these in our CI pipeline. The simpler set up would be to run all tests for each PR merging into dev

Current Behavior

Tests are only run if developers trigger them manually.

Any other notes

No response

Assignment

This issue is free for anyone to take

@mnixo
Copy link
Contributor

mnixo commented Jul 1, 2024

!request

Copy link

github-actions bot commented Jul 1, 2024

🤖 meep morp!

Thank you for your contribution @mnixo - this Issue is assigned to you as requested ✨

🔎 Please keep in mind that in order to give everyone a chance to contribute Issues may be unassigned if they go stale.
You will be warned if the Issue is marked as stale at any point.

🔎 Please review our documentation for guidance on:

  • common Patterns we follow in the code base
  • conventions set for commit messages and naming of functions, classes or files

💡 The core team is available for any help and will try to respond to any comments in this Issue or questions on discord as quickly as possible.

Happy coding ! 🦆

@mnixo
Copy link
Contributor

mnixo commented Jul 1, 2024

Storybook facilitates the integration of different types of tests, some of them including:

  • Visual tests.
    • Based on Chromatic.
    • Focuses on visual regression testing, with the goal to catch unintended visual changes that could go unnoticed in other test types.
    • The Chromatic dashboard is feature-rich but could be cumbersome in a collaborative context.
    • Probably not as important as other types of tests.
    • Intended changes will still have to be reviewed manually.
  • Interaction tests.
    • Based on play functions. More play functions = more component documentation + more coverage.
    • Very functional.
    • Easy to follow in the Storybook UI.
    • The project already has a few play functions.
  • User flow tests.
    • Based on Cypress.
    • Nice DX with the Cypress UI.
    • Solid E2E option integrated in Storybook.
    • Don't need Supabase to run.
    • Would be nice to check how "E2E" they really are with a real use case.
    • Although there are already Cypress tests in the project, they might not be appropriate in this context.

It is important to note that these tests run in the context of Storybook, so there might be a few caveats.

For future reference, this PR has some exploratory work on how to integrate these in the project's CI.

@camelPhonso
Copy link
Contributor Author

Closed this one as the PR associated has been merged.

But I'm curious on your take from looking at the user flow tests. To me it looks like having interaction tests for all our components and cypress e2e for the different user stories associated with each Milestone would be the better way to get decent coverage and the user flow stuff seems a bit redundant - specially if it actually ignores the context of the app 🤔

@mnixo
Copy link
Contributor

mnixo commented Jul 4, 2024

To me it looks like having interaction tests for all our components and cypress e2e for the different user stories associated with each Milestone would be the better way to get decent coverage and the user flow stuff seems a bit redundant - specially if it actually ignores the context of the app 🤔

There's definitely a considerable overlap between the two. Having a "real" E2E context (with Supabase) would definitely be better. In this case it seems that the user flow tests are just "as E2E as you can get" just within the Storybook context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

2 participants