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

Fix codegen-openapi tests #4307

Merged
merged 82 commits into from
Aug 30, 2024
Merged

Conversation

aryaemami59
Copy link
Contributor

@aryaemami59 aryaemami59 commented Mar 27, 2024

Overview

Previously the codegen tests would create side effects which made them unpredictable and caused them to produce inconsistent results. This PR mainly focuses on making the unit tests reliable both during local development and CI.

This PR:

  • Replaces the old cli command in cli.test.ts with a promisified version of Node's exec which mimicks the actual cli behavior more closely.
  • Revamps the tsconfig setup to have a tsconfig.build.json and tsconfig.json as opposed to a test/tsconfig.json with baseUrl.
  • Uses path aliasing to test against the output lib folder during CI. vite-tsconfig-paths was added to devDependencies to manage this easier.
  • Creates a more comprehensive CI workflow for the codegen-openapi that tests against the final build artifact on different operating systems (This change will become active in Fix codegen-openapi build output #4509 since that PR is responsible for fixing the build output).

Copy link

codesandbox bot commented Mar 27, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@aryaemami59 aryaemami59 changed the title Fix codegen tests Fix codegen-openapi tests Mar 27, 2024
Copy link

netlify bot commented Mar 27, 2024

Deploy Preview for redux-starter-kit-docs ready!

Name Link
🔨 Latest commit 91aea9a
🔍 Latest deploy log https://app.netlify.com/sites/redux-starter-kit-docs/deploys/66d20e8dbf2e42000932fe1a
😎 Deploy Preview https://deploy-preview-4307--redux-starter-kit-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codesandbox-ci bot commented Mar 27, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 91aea9a:

Sandbox Source
@examples-query-react/basic Configuration
@examples-query-react/advanced Configuration
@examples-action-listener/counter Configuration
rtk-esm-cra Configuration

@aryaemami59 aryaemami59 force-pushed the fix-codegen-tests branch 4 times, most recently from abbeed1 to b493d3e Compare August 27, 2024 08:20
@markerikson markerikson merged commit 602f012 into reduxjs:master Aug 30, 2024
50 checks passed
@markerikson markerikson deleted the fix-codegen-tests branch August 30, 2024 18:33
@markerikson
Copy link
Collaborator

@aryaemami59 fyi the "ts/json/etc should be the same" test seems to be flaky - sometimes it can't find example.ts. Some kind of filesystem race condition, maybe?

@aryaemami59
Copy link
Contributor Author

Yup that's exactly what it is. I'll have to look into it later.

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

Successfully merging this pull request may close these issues.

2 participants