Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[CORE FEATURE] Devise testing strategy (unit, integration, etc.) and incorporate into CI/CD workflow #10

Open
awpala opened this issue May 10, 2022 · 6 comments
Labels
enhancement New feature or request no-issue-activity
Milestone

Comments

@awpala
Copy link
Contributor

awpala commented May 10, 2022

No description provided.

@driscoll42 driscoll42 moved this to Backlog in OMSHub Project Tasks May 10, 2022
@driscoll42 driscoll42 changed the title Devise testing strategy (unit, integration, etc.) and incorporate into CI/CD workflow [CORE FEATURE] Devise testing strategy (unit, integration, etc.) and incorporate into CI/CD workflow May 11, 2022
@driscoll42 driscoll42 added this to the MVP milestone May 11, 2022
@driscoll42 driscoll42 moved this to Staging in OMSHub Project Tasks May 11, 2022
@ashiquem
Copy link
Contributor

What: Evolving decision framework for testing, enabling development of high quality reliable software

Required outcomes:

  • define definition of done for each feature from testing perspective eg. code coverage for unit tests, risk based testing for functional tests etc
  • establish quality gates: define important metrics for blocking builds if any, code coverage, code smells other static analysis etc
  • tool selection: adopt a tool selection framework and decide on current tools necessary, eg functional,unit testing tools
  • monitoring and reporting(stretch): ensure developer has means of assessing product quality through metrics report eg assess if current CI tools enable reporting of test metrics in the best manner, if we need dashboards

@disposedtrolley
Copy link
Contributor

Agreeing on some tenets on software testing and quality will serve us well, those are some great discussion points @ashiquem!

establish quality gates: define important metrics for blocking builds if any, code coverage, code smells other static analysis etc

I like to double-down on checks that are difficult to implement if we don't do it early on. Linters and formatters are one example of this; we should think about enforcing Prettier and ESLint checks as a prerequisite for merge. Diffs become much, much easier to parse when we're all coding in the same style. There's nothing worse than a one line change that shows as 10 files modified because an editor decided to change the number of spaces for indentation!

tool selection: adopt a tool selection framework and decide on current tools necessary, eg functional,unit testing tools

There'll be a lot of flux in the codebase as the MVP gets built, so ideally we'd want a strategy that allows for rapid change while ensuring the important parts of the application continue to function (the 80/20 rule and critical user journeys play a part in defining what we consider important). Tight feedback loops are what we want to strive for.

To that end, I think we should investigate end-to-end browser testing. These tests will execute against the live application and mimic the interactions of a user and serve as good integration tests. They're more resilient to change than unit tests, and allow us more freedom to refactor code without worrying about changing a whole suite of unit tests. Playwright is a good choice for these tests.

Vercel also deploys PR branches automatically for us (see this PR comment as an example), so we can set up a GitHub Actions workflow (or similar) to execute these tests against the preview environment.

There are a couple of issues that we could PoC out straight away:

  1. Adding a GitHub Actions workflow to run Prettier and ESLint on PR branches, and making these a prerequisite for merging the change.
  2. Scaffolding out a Playwright spec that navigates to a target URL and makes a dummy assertion on some content on the page. Add this to a GitHub Actions job and feed it the preview URL that Vercel generates.

@ashiquem ashiquem moved this from Staging to In Progress in OMSHub Project Tasks May 11, 2022
@awpala
Copy link
Contributor Author

awpala commented May 11, 2022

Agreed to focus on the core feature set; proving that React renders a component is not very valuable here, but proving that a user can interact with the views and post reviews--that's the do the thing thing our thing is supposed to do!

@awpala
Copy link
Contributor Author

awpala commented May 11, 2022

Also +1 for Playwright for E2E and integration testing, we use it at my workplace, and together with RTL they form a killer combo for all things React frontend testing! For anything involving a critical user path through the app/views, that would be a smart move, tooling-wise.

@disposedtrolley
Copy link
Contributor

Also +1 for Playwright for E2E and integration testing

I might give this a try as my next task!

@awpala awpala moved this from In Progress to Todo in OMSHub Project Tasks Aug 7, 2022
@awpala awpala moved this from Todo to Staging in OMSHub Project Tasks Aug 7, 2022
@awpala awpala added enhancement New feature or request and removed core features labels Aug 20, 2022
@omshub omshub deleted a comment from github-actions bot Aug 27, 2024
Copy link

This issue is stale because it has been open for 60 days with no activity.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request no-issue-activity
Projects
Status: Backlog
Development

No branches or pull requests

4 participants