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

feat(ci): Add test step to CI #703

Merged
merged 2 commits into from
Oct 23, 2023
Merged

Conversation

mcanueste
Copy link
Contributor

@mcanueste mcanueste commented Oct 22, 2023

Description

  • Adds test:nowatch script to packages containing tests for running vitest without watching files. vitest command runs tests in watch mode, so it waits for file changes. This is undesirable for CI, hence, the test:nowatch script.
  • Adds cache: npm arg to setup step for caching npm installs in CI jobs. Doesn't effect the testing, but a nice addition to cache npm installs to speed up CI for subsequent runs.
  • Added test step before build step for early fail in CI before build step. Build takes longer to finish, but tests are much faster. It would be good idea to get feedback about the tests without waiting for the build.

NOTE: Related to task #663, so this PR should be merged first. It is not a blocker, but this PR runs tests only for apps/gql and packages/gql-utils as the test:nowatch was only added to those packages. The other packages containing test configuration will be removed after the PR since they don't have tests.

Checklist

  • discord username: muroyoe#9144
  • Closes ci: update ci.yml to include a test step after build #664
  • PR must be created for an issue from issues under "In progress" column from our project board.
  • A descriptive and understandable title: The PR title should clearly describe the nature and purpose of the changes. The PR title should be the first thing displayed when the PR is opened. And it should follow the semantic commit rules, and should include the app/package/service name in the title. For example, a title like "docs(@kampus-apps/pano): Add README.md" can be used.
  • Related file selection: Only relevant files should be touched and no other files should be affected.
  • I ran npx turbo run at the root of the repository, and build was successful.
  • I installed the npm packages using npm install --save-exact <package> so my package is pinned to a specific npm version. Leave empty if no package was installed. Leave empty if no package was installed with this PR.

How were these changes tested?

After the changes, I triggered the CI pipeline in my fork. See here for the pipeline outputs.

@vercel
Copy link

vercel bot commented Oct 22, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
kampus-studio ⬜️ Ignored (Inspect) Visit Preview Oct 23, 2023 0:43am

@vercel
Copy link

vercel bot commented Oct 22, 2023

@mcanueste is attempting to deploy a commit to the kamp-us Team on Vercel.

A member of the Team first needs to authorize it.

- Adds `test:nowatch` script to packages containing tests for running vitest without watching files
- Adds `cache: npm` arg to setup step for caching npm installs in CI jobs
- Added test step before build step for early fail in CI before build step
@mcanueste mcanueste changed the title fix(ci): Add test step to CI feat(ci): Add test step to CI Oct 22, 2023
Copy link
Member

@usirin usirin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing 💯

@usirin usirin merged commit 53e0bed into kamp-us:dev Oct 23, 2023
2 of 6 checks passed
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

Successfully merging this pull request may close these issues.

ci: update ci.yml to include a test step after build
2 participants