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
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 72 additions & 7 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions common/tools/dev-tool/src/commands/admin/migrate-package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export default mergeConfig(
async function writeBrowserTestConfig(packageFolder: string): Promise<void> {
const testConfig = {
extends: "./.tshy/build.json",
include: ["./src/**/*.ts", "./src/**/*.mts", "./test/**/*.spec.ts"],
include: ["./src/**/*.ts", "./src/**/*.mts", "./test/**/*.spec.ts", "./test/**/*.mts"],
exclude: ["./test/**/node/**/*.ts"],
compilerOptions: {
outDir: "./dist-test/browser",
Expand All @@ -176,7 +176,7 @@ async function writeBrowserTestConfig(packageFolder: string): Promise<void> {
},
};

await saveJson(resolve(packageFolder, "test.browser.config.json"), testConfig);
await saveJson(resolve(packageFolder, "tsconfig.browser.config.json"), testConfig);
}

async function fixApiExtractorConfig(apiExtractorJsonPath: string): Promise<void> {
Expand Down Expand Up @@ -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?

scripts["unit-test:node"] = "dev-tool run test:vitest";

for (const script of Object.keys(scripts)) {
Expand Down
4 changes: 2 additions & 2 deletions sdk/attestation/attestation/api-extractor.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "types/src/index.d.ts",
"mainEntryPointFilePath": "dist/esm/index.d.ts",
"docModel": {
"enabled": true
},
Expand All @@ -11,7 +11,7 @@
"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "",
"publicTrimmedFilePath": "./types/latest/attestation.d.ts"
"publicTrimmedFilePath": "dist/attestation.d.ts"
},
"messages": {
"tsdocMessageReporting": {
Expand Down
139 changes: 0 additions & 139 deletions sdk/attestation/attestation/karma.conf.js

This file was deleted.

Loading
Loading