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

[Template] Build test package failing in nightly runs #29867

Closed
jerryshia opened this issue May 31, 2024 · 4 comments
Closed

[Template] Build test package failing in nightly runs #29867

jerryshia opened this issue May 31, 2024 · 4 comments
Assignees
Labels
Azure.Template Issues related to the Azure.Template project that can be used as a starting point for our libraries. Client This issue points to a problem in the data-plane of the library. test-reliability Issue that causes tests to be unreliable

Comments

@jerryshia
Copy link
Member

Template nightly test runs are failing with:

Error message:
configurationClient.spec.ts(5,37): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("../../src/index.js")' call instead.
To convert this file to an ECMAScript module, change its file extension to '.mts', or add the field "type": "module" to '/mnt/vss/_work/1/s/sdk/template/template/test/public/package.json'.
Error: Failed calling tsc -p .. Exit code: 2

##[error]Bash exited with code '2'.

For more details check here:
https://dev.azure.com/azure-sdk/internal/_build/results?buildId=3831833&view=results

@github-actions github-actions bot added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label May 31, 2024
@v-xuto v-xuto added Client This issue points to a problem in the data-plane of the library. test-reliability Issue that causes tests to be unreliable Azure.Template Issues related to the Azure.Template project that can be used as a starting point for our libraries. and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels May 31, 2024
@jeremymeng
Copy link
Member

This only happens in min/max testing. Looks an known issue in vitest. We may need to upgrade the vitest dependency version since it is passing in normal runs.

"tsc -p ."

../../../../../common/temp/node_modules/.pnpm/@types[email protected]/node_modules/@types/chai/index.d.ts(1,1): error TS6200: Definitions of the following identifiers conflict with those in another file: Message, ObjectProperty, ChaiPlugin, AssertionArgs, Operator, OperatorComparable, AssertionError, chai
../../../../../common/temp/node_modules/.pnpm/@vitest[email protected]/node_modules/@vitest/expect/dist/chai.d.cts(16,1): error TS6200: Definitions of the following identifiers conflict with those in another file: Message, ObjectProperty, ChaiPlugin, AssertionArgs, Operator, OperatorComparable, AssertionError, chai
../../../../../common/temp/node_modules/.pnpm/vite-node@1.6.0_@types[email protected]/node_modules/vite-node/dist/index-O2IrwHKf.d.ts(87,14): error TS2304: Cannot find name 'WebSocket'.
../../../../../common/temp/node_modules/.pnpm/vite@5.2.12_@types[email protected]/node_modules/vite/types/customEvent.d.ts(27,14): error TS2304: Cannot find name 'WebSocket'.
../../../../../common/temp/node_modules/.pnpm/vite@5.2.12_@types[email protected]/node_modules/vite/types/importGlob.d.ts(38,11): error TS2304: Cannot find name 'Worker'.
../../../../../common/temp/node_modules/.pnpm/vitest@1.6.0_@types+node@18.19.33_@vitest[email protected]/node_modules/vitest/index.d.cts(1,15): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("./dist/index.js")' call instead.
configurationClient.spec.ts(5,37): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("../../src/index.js")' call instead.
To convert this file to an ECMAScript module, change its file extension to '.mts', or add the field "type": "module" to '/mnt/vss/_work/1/s/sdk/template/template/test/public/package.json'.

@xirzec
Copy link
Member

xirzec commented Jun 3, 2024

@mpodwysocki maybe time to bump some minimum versions?

@mpodwysocki mpodwysocki self-assigned this Jun 4, 2024
@jeremymeng
Copy link
Member

jeremymeng commented Jun 4, 2024

The problem is actually because dependency-testing does not support newer testing via vitest yet. What it does is creating a package under test/public directory with the updated dependency versions, and build that package (tsc -p .), then run a command for integration test

"integration-test:node": "mocha --require tsx --require source-map-support/register --reporter mocha-multi-reporter.js --reporter-option output=test-results.xml --timeout 350000 --full-trace \"dist-esm/**/{,!(browser)/**/}*.spec.js\" --exit",

@jeremymeng jeremymeng self-assigned this Jun 4, 2024
jeremymeng added a commit that referenced this issue Jun 13, 2024
by writing a copy of vitest config file to the test/public project and update
related commands to run vitest.

This PR addresses NodeJs only.

Related issue: #29867
@jeremymeng
Copy link
Member

pipeline has been green recently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure.Template Issues related to the Azure.Template project that can be used as a starting point for our libraries. Client This issue points to a problem in the data-plane of the library. test-reliability Issue that causes tests to be unreliable
Projects
None yet
Development

No branches or pull requests

6 participants