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

[monitor] Move @azure/monitor-opentelemetry-exporter to ESM/vitest #31448

Open
wants to merge 23 commits into
base: main
Choose a base branch
from

Conversation

mpodwysocki
Copy link
Member

Packages impacted by this PR

  • @azure/monitor-opentelemetry-exporter

Issues associated with this PR

Describe the problem that is addressed by this PR

Upgrades to ESM/vitest for @azure/monitor-opentelemetry-exporter

What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen?

Are there test cases added in this PR? (If not, why?)

Provide a list of related PRs (if any)

Command used to generate this PR:**(Applicable only to SDK release request PRs)

Checklists

  • Added impacted package name to the issue description
  • Does this PR needs any fixes in the SDK Generator?** (If so, create an Issue in the Autorest/typescript repository and link it here)
  • Added a changelog (if necessary)

@azure-sdk
Copy link
Collaborator

API change check

API changes are not detected in this pull request.

Copy link
Member

@maorleger maorleger left a comment

Choose a reason for hiding this comment

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

Lovely!

@@ -32,20 +29,15 @@
"test:node": "npm run clean && npm run build:test && npm run unit-test:node",
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
"unit-test:browser": "echo skipped",
"unit-test:node": "dev-tool run test:node-tsx-ts -- --timeout 1200000 \"test/internal/**/*.test.ts\"",
"unit-test:node:debug": "dev-tool run test:node-tsx-ts -- --timeout 1200000 \"test/internal/**/*.test.ts\"",
"unit-test:node": "dev-tool run test:vitest",
Copy link
Member

Choose a reason for hiding this comment

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

I want to add a mod to do this automatically, but do note that the timeouts need to be copied over manually. Mocha had one timeout but vitest has test-timeout and hook-timeout so either one might need to be updated

@@ -66,18 +66,6 @@ describe("FileSystemPersist", () => {
deleteFolderRecursive(tempDir);
});

afterEach((done) => {
fs.readdir(tempDir, (err, files) => {
Copy link
Member

Choose a reason for hiding this comment

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

Is this no longer needed?

assert.strictEqual(envelope.name, name);
assert.strictEqual(envelope.sampleRate, sampleRate);
assert.deepStrictEqual(envelope.data?.baseType, baseType);
assert.isDefined(envelope);
Copy link
Member

Choose a reason for hiding this comment

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

would assert.exist give you better typing so you don't need the ? below? Sometimes it works for me and sometimes it does not - I think it depends on where the typings come from (chai or vitest's chai) but one of them is a typeguard

this is a test, so not too concerned

const envelope = {
name: "Name",
time: new Date(),
};

before(() => {
beforeAll(() => {
Copy link
Member

Choose a reason for hiding this comment

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

was this migrated automatically or manually? If manually, I can add this to the list of codemods

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.

3 participants