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: move ts tests in a separate workspace, collect coverage only once #2147

Merged
merged 1 commit into from Feb 24, 2024

Conversation

marcalexiei
Copy link
Member

@marcalexiei marcalexiei commented Feb 24, 2024

Point 2 of #2142

Typescript tests

Typescript tests have been moved in a separate workspace.
To run them now you have to run npm run test:typescript, as a side effect all ts workspaces no longer have ts- prefix.

CI: Test

Now coverage should be collected only once (when running node 20 matrix value).
On node 18 tests are executed without using coverage.

CI: Typescript

Now CI should be able to test types with both typescript 4 and 5.

See this comment

Checklist

  • only relevant code is changed (make a diff before you submit the PR)
  • run tests npm run test
  • tests are included
  • commit message and code follows the Developer's Certification of Origin

@marcalexiei marcalexiei marked this pull request as draft February 24, 2024 08:40
@marcalexiei marcalexiei force-pushed the feature/tests-improvements branch 2 times, most recently from 4de51d5 to de7799b Compare February 24, 2024 08:42
@coveralls
Copy link

coveralls commented Feb 24, 2024

Coverage Status

coverage: 96.191%. remained the same
when pulling 2d94fdf on marcalexiei:feature/tests-improvements
into 3a247e1 on i18next:master.

@marcalexiei marcalexiei force-pushed the feature/tests-improvements branch 2 times, most recently from c5268a5 to 7ac30c4 Compare February 24, 2024 08:49
@marcalexiei
Copy link
Member Author

Looks like testing both typescript supported version is not that simple.
It looks like that typescript doesn't read typesVersion in package.json` locally.

Will think about it and than I'll open a separate PR since it looks more complicated than I expected 😅

@marcalexiei
Copy link
Member Author

Besides typescript issue the optimisation performed has reduced the CI execution time by ~50%:

https://github.com/i18next/i18next/actions/workflows/CI.yml?query=is%3Asuccess

Running test with or without coverage based upon matrix value, avoiding to run runtime and compatibility project twice,
paid off 😀.

@marcalexiei marcalexiei marked this pull request as ready for review February 24, 2024 09:14
@marcalexiei marcalexiei mentioned this pull request Feb 24, 2024
2 tasks
@marcalexiei marcalexiei changed the title test: move ts tests in a separate workspace, add test for ts v4, collect coverage only once test: move ts tests in a separate workspace, collect coverage only once Feb 24, 2024
@adrai adrai merged commit 4685bea into i18next:master Feb 24, 2024
9 checks passed
@marcalexiei marcalexiei deleted the feature/tests-improvements branch February 24, 2024 13:03
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.

None yet

3 participants