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

[attestation] Migrate to ESM and tshy #31433

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

Conversation

maorleger
Copy link
Member

@maorleger maorleger commented Oct 16, 2024

Packages impacted by this PR

@azure/attestation

Issues associated with this PR

#31338

Describe the problem that is addressed by this PR

Migrates @azure/attestation to ESM and tshy. This took under an hour of active work!

  • Add changelog entry

@github-actions github-actions bot added Attestation dev-tool Issues related to the Azure SDK for JS dev-tool labels Oct 16, 2024
@maorleger
Copy link
Member Author

/azp run js - attestation - tests

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@azure-sdk
Copy link
Collaborator

API change check

API changes are not detected in this pull request.

@@ -266,7 +266,7 @@ function setScriptsSection(scripts: PackageJson["scripts"]): void {
scripts["build"] = "npm run clean && dev-tool run build-package && dev-tool run extract-api";

scripts["unit-test:browser"] =
"npm run clean && dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --no-test-proxy --browser";
"npm run clean && dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --browser";
Copy link
Member

Choose a reason for hiding this comment

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

Would we assume the test-proxy is required for unit tests as well as for integration tests?

Copy link
Member Author

@maorleger maorleger Oct 17, 2024

Choose a reason for hiding this comment

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

I think the no-test-proxy flag should be reserved for packages that don’t use recordings at all, but I could be overlooking something.

Currently, the TEST_MODE environment variable seems to guide whether we use the proxy or not:

  • playback (default): true
  • recording: true
  • live: false

However, the challenge I see is the distinction between unit-test and integration-test. This split seems to come from when we used to run unit-test from source code and integration-test from the distribution (JavaScript). But now that we’ve consolidated everything under Vitest, it raises the question: should integration-test only be used for live tests now? Or should we just rely on TEST_MODE entirely?

Another option could be to remove the integration-test script altogether, as running TEST_MODE=live rushx unit-test would achieve the same result as the current integration-test. This might be something worth discussing with the team, as the purpose behind keeping both scripts isn't entirely clear to me anymore.

idk, what do folks think?

@@ -28,8 +28,8 @@ import { DefaultAzureCredential } from "@azure/identity";

// Load environment from a .env file if it exists.
import * as dotenv from "dotenv";
Copy link
Member

Choose a reason for hiding this comment

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

Nit, but I wonder if we could rewrite import "dotenv/config";

@maorleger maorleger marked this pull request as ready for review October 17, 2024 22:30
@maorleger
Copy link
Member Author

/azp run js - attestation - tests

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Attestation dev-tool Issues related to the Azure SDK for JS dev-tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants