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

test(maintenance): switch tracer to vitest #3285

Merged
merged 4 commits into from
Nov 5, 2024
Merged

test(maintenance): switch tracer to vitest #3285

merged 4 commits into from
Nov 5, 2024

Conversation

dreamorosi
Copy link
Contributor

Summary

Changes

Please provide a summary of what's being changed

This PR moves the unit and end to end tests for the Tracer package to use vitest as test runner.

This action is part of the ongoing migration from Jest to Vitest, and the vast majority of the changes in the tests focus on changing the imports and using Vitest-specific APIs.

The file with most changes is the packages/tracer/tests/unit/Provider.test.ts, which has a module import mock for the aws-xray-sdk-node package. Because Jest and Vitest mock imports slightly differently, I had to make more changes in this file than in others.

I also have removed some redundant test cases while maintaining the same level of coverage.

Two extra files from other packages were touched, respectively for:

  • setupEnv.ts under packages/testing was modified to include two environment variables needed for Tracer during tests.
  • One Logger test case was modified to take in account the new value of an env variable that was modified as part of the point above.

Please add the issue number below, if no issue is present the PR might get blocked and not be reviewed

Issue number: closes #3284


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@dreamorosi dreamorosi self-assigned this Nov 4, 2024
@dreamorosi dreamorosi requested review from a team as code owners November 4, 2024 17:40
@boring-cyborg boring-cyborg bot added automation This item relates to automation dependencies Changes that touch dependencies, e.g. Dependabot, etc. internal PRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.) tests PRs that add or change tests tracer This item relates to the Tracer Utility labels Nov 4, 2024
@pull-request-size pull-request-size bot added the size/XXL PRs with 1K+ LOC, largely documentation related label Nov 4, 2024
@dreamorosi
Copy link
Contributor Author

Copy link
Contributor

@am29d am29d left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! I have only few questions for clarification and we are good to merge.

packages/tracer/src/Tracer.ts Show resolved Hide resolved
packages/tracer/tests/unit/Tracer.test.ts Outdated Show resolved Hide resolved
@am29d am29d self-requested a review November 5, 2024 08:43
@dreamorosi
Copy link
Contributor Author

@am29d thanks for the review, addressed your comments & ready for another round.

Copy link

sonarqubecloud bot commented Nov 5, 2024

@am29d am29d merged commit 4245241 into main Nov 5, 2024
24 checks passed
@am29d am29d deleted the chore/tracer_vitest branch November 5, 2024 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation This item relates to automation dependencies Changes that touch dependencies, e.g. Dependabot, etc. internal PRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.) size/XXL PRs with 1K+ LOC, largely documentation related tests PRs that add or change tests tracer This item relates to the Tracer Utility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Maintenance: migrate test runner to vitest for tracer package
2 participants