Skip to content

Commit

Permalink
test: run vite e2e in development mode
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhe committed Oct 31, 2024
1 parent 5c24c24 commit 4c2031a
Show file tree
Hide file tree
Showing 22 changed files with 28 additions and 45 deletions.
2 changes: 1 addition & 1 deletion clients/client-cognito-identity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"extract:docs": "api-extractor run --local",
"generate:client": "node ../../scripts/generate-clients/single-service --solo cognito-identity",
"test:e2e": "vitest run -c vitest.config.e2e.ts",
"test:e2e": "vitest run -c vitest.config.e2e.ts --mode development",
"test:e2e:watch": "vitest watch -c vitest.config.e2e.ts"
},
"main": "./dist-cjs/index.js",
Expand Down
1 change: 0 additions & 1 deletion clients/client-cognito-identity/vitest.config.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ export default defineConfig({
test: {
include: ["**/*.e2e.spec.ts"],
environment: "happy-dom",
env: process.env as Record<string, string>,
},
});
2 changes: 1 addition & 1 deletion clients/client-kinesis/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"extract:docs": "api-extractor run --local",
"generate:client": "node ../../scripts/generate-clients/single-service --solo kinesis",
"test:e2e": "vitest run -c vitest.config.e2e.ts",
"test:e2e": "vitest run -c vitest.config.e2e.ts --mode development",
"test:e2e:watch": "vitest watch -c vitest.config.e2e.ts"
},
"main": "./dist-cjs/index.js",
Expand Down
1 change: 0 additions & 1 deletion clients/client-kinesis/vitest.config.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ export default defineConfig({
test: {
include: ["**/*.e2e.spec.ts"],
environment: "node",
env: process.env as Record<string, string>,
},
});
4 changes: 2 additions & 2 deletions clients/client-s3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
"generate:client": "node ../../scripts/generate-clients/single-service --solo s3",
"test": "vitest run",
"test:watch": "vitest watch",
"test:e2e": "vitest run -c vitest.config.e2e.ts && yarn test:browser",
"test:e2e": "vitest run -c vitest.config.e2e.ts --mode development && yarn test:browser",
"test:e2e:watch": "vitest watch -c vitest.config.e2e.ts",
"test:browser": "node ./test/browser-build/esbuild && vitest run -c vitest.config.browser.ts",
"test:browser": "node ./test/browser-build/esbuild && vitest run -c vitest.config.browser.ts --mode development",
"test:browser:watch": "node ./test/browser-build/esbuild && vitest watch -c vitest.config.browser.ts"
},
"main": "./dist-cjs/index.js",
Expand Down
1 change: 0 additions & 1 deletion clients/client-s3/vitest.config.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ export default defineConfig({
exclude: ["**/*.browser.e2e.spec.ts"],
include: ["**/*.e2e.spec.ts"],
environment: "node",
env: process.env as Record<string, string>,
},
});
2 changes: 1 addition & 1 deletion clients/client-transcribe-streaming/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"extract:docs": "api-extractor run --local",
"generate:client": "node ../../scripts/generate-clients/single-service --solo transcribe-streaming",
"test:e2e": "vitest run -c vitest.config.e2e.ts",
"test:e2e": "vitest run -c vitest.config.e2e.ts --mode development",
"test:e2e:watch": "vitest watch -c vitest.config.e2e.ts"
},
"main": "./dist-cjs/index.js",
Expand Down
1 change: 0 additions & 1 deletion clients/client-transcribe-streaming/vitest.config.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ export default defineConfig({
test: {
include: ["**/*.e2e.spec.ts"],
environment: "node",
env: process.env as Record<string, string>,
},
});
2 changes: 1 addition & 1 deletion lib/lib-dynamodb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"extract:docs": "api-extractor run --local",
"test": "vitest run",
"test:e2e": "vitest run -c vitest.config.e2e.ts",
"test:e2e": "vitest run -c vitest.config.e2e.ts --mode development",
"test:watch": "vitest watch",
"test:e2e:watch": "vitest watch -c vitest.config.e2e.ts"
},
Expand Down
1 change: 0 additions & 1 deletion lib/lib-dynamodb/vitest.config.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ export default defineConfig({
test: {
include: ["**/*.e2e.spec.ts"],
environment: "node",
env: process.env as Record<string, string>,
},
});
2 changes: 1 addition & 1 deletion lib/lib-storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"extract:docs": "api-extractor run --local",
"test": "vitest run",
"test:e2e": "vitest run -c vitest.config.e2e.ts",
"test:e2e": "vitest run -c vitest.config.e2e.ts --mode development",
"test:watch": "vitest watch",
"test:e2e:watch": "vitest watch -c vitest.config.e2e.ts"
},
Expand Down
2 changes: 0 additions & 2 deletions lib/lib-storage/src/lib-storage.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { setTestCredentials } from "@aws-sdk/aws-util-test";
import { S3 } from "@aws-sdk/client-s3";
import { Upload } from "@aws-sdk/lib-storage";
import type { AwsCredentialIdentity } from "@smithy/types";
import { randomBytes } from "crypto";
import { Readable } from "stream";
import { afterAll, beforeAll, describe, expect, test as it } from "vitest";
Expand Down Expand Up @@ -111,7 +110,6 @@ describe("@aws-sdk/lib-storage", () => {

const client = new MockFailureS3({
region,
credentials,
});

const requestLog = [] as string[];
Expand Down
1 change: 0 additions & 1 deletion lib/lib-storage/vitest.config.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ export default defineConfig({
test: {
include: ["**/*.e2e.spec.ts"],
environment: "node",
env: process.env as Record<string, string>,
},
});
2 changes: 1 addition & 1 deletion packages/ec2-metadata-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"test": "vitest run --passWithNoTests",
"test:e2e": "vitest run -c vitest.config.e2e.ts",
"test:e2e": "vitest run -c vitest.config.e2e.ts --mode development",
"test:watch": "vitest watch --passWithNoTests",
"test:e2e:watch": "vitest watch -c vitest.config.e2e.ts"
},
Expand Down
1 change: 0 additions & 1 deletion packages/ec2-metadata-service/vitest.config.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ export default defineConfig({
test: {
include: ["**/*.e2e.spec.ts"],
environment: "node",
env: process.env as Record<string, string>,
},
});
2 changes: 1 addition & 1 deletion packages/middleware-sdk-s3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"test": "vitest run",
"test:integration": "vitest run -c vitest.config.integ.ts",
"test:e2e": "vitest run -c vitest.config.e2e.ts",
"test:e2e": "vitest run -c vitest.config.e2e.ts --mode development",
"extract:docs": "api-extractor run --local",
"test:watch": "vitest watch",
"test:integration:watch": "vitest watch -c vitest.config.integ.ts",
Expand Down
1 change: 0 additions & 1 deletion packages/middleware-sdk-s3/vitest.config.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ export default defineConfig({
test: {
include: ["**/*.e2e.spec.ts"],
environment: "node",
env: process.env as Record<string, string>,
},
});
2 changes: 1 addition & 1 deletion packages/s3-presigned-post/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"extract:docs": "api-extractor run --local",
"test": "vitest run",
"test:e2e": "vitest run -c vitest.config.e2e.ts",
"test:e2e": "vitest run -c vitest.config.e2e.ts --mode development",
"test:watch": "vitest watch",
"test:e2e:watch": "vitest watch -c vitest.config.e2e.ts"
},
Expand Down
1 change: 0 additions & 1 deletion packages/s3-presigned-post/vitest.config.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ export default defineConfig({
test: {
include: ["**/*.e2e.spec.ts"],
environment: "node",
env: process.env as Record<string, string>,
},
});
40 changes: 18 additions & 22 deletions scripts/turbo/index.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,35 @@
// Build script to handle Turborepo build execution
const { spawnProcess } = require("../utils/spawn-process");
const path = require("path");
const { loadSharedConfigFiles } = require("@smithy/shared-ini-file-loader");

const runTurbo = async (task, args, { apiSecret, apiEndpoint, apiSignatureKey } = {}) => {
const command = ["turbo", "run", task, "--concurrency=100%", "--output-logs=hash-only"];
command.push(...args);
const turboRoot = path.join(__dirname, "..", "..");

const ini = await loadSharedConfigFiles();
const profileData = ini.configFile["sdk-integ-test"];
if (profileData) {
console.log("Setting AWS_PROFILE=sdk-integ-test");
process.env.AWS_PROFILE = "sdk-integ-test";
}
const turboEnv = {
...process.env,
TURBO_TELEMETRY_DISABLED: "1",
...(apiSecret &&
apiEndpoint &&
apiSignatureKey && {
TURBO_API: apiEndpoint,
TURBO_REMOTE_CACHE_SIGNATURE_KEY: apiSignatureKey,
TURBO_TOKEN: apiSecret,
TURBO_TEAM: "aws-sdk-js",
}),
...(!process.env.CODEBUILD_BUILD_ARN && {
TURBO_REMOTE_CACHE_READ_ONLY: "1",
}),
};

console.log("TURBO ENV", env);

try {
return await spawnProcess("yarn", command, {
stdio: "inherit",
cwd: turboRoot,
env: {
...process.env,
TURBO_TELEMETRY_DISABLED: "1",
...(apiSecret &&
apiEndpoint &&
apiSignatureKey && {
TURBO_API: apiEndpoint,
TURBO_REMOTE_CACHE_SIGNATURE_KEY: apiSignatureKey,
TURBO_TOKEN: apiSecret,
TURBO_TEAM: "aws-sdk-js",
}),
...(!process.env.CODEBUILD_BUILD_ARN && {
TURBO_REMOTE_CACHE_READ_ONLY: "1",
}),
},
env,
});
} catch (error) {
console.error("Error running turbo:", error);
Expand Down
1 change: 0 additions & 1 deletion tests/e2e/get-integ-test-resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ exports.getIntegTestResources = async () => {

const cloudformation = new CloudFormationClient({
region,
logger: console,
});
const stackName = "SdkReleaseV3IntegTestResourcesStack";

Expand Down
1 change: 0 additions & 1 deletion vitest.config.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ export default defineConfig({
exclude: ["node_modules", "**/*.browser.e2e.spec.ts"],
include: ["**/*.e2e.spec.ts"],
environment: "node",
env: process.env as Record<string, string>,
},
});

0 comments on commit 4c2031a

Please sign in to comment.