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

chore: bump uuid versions in test packages #9641

Merged
merged 1 commit into from
Feb 3, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion packages/amplify-e2e-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@
"rimraf": "^3.0.0",
"strip-ansi": "^6.0.0",
"throat": "^5.0.0",
"uuid": "7.0.1"
"uuid": "^8.3.2"
}
}
28 changes: 8 additions & 20 deletions packages/amplify-e2e-core/src/cli-test-runner.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,18 @@
const circusRunner = require("jest-circus/runner");
const throat = require("throat");
const uuid = require("uuid");
const circusRunner = require('jest-circus/runner');
const throat = require('throat');
const { v4: uuid } = require('uuid');

const mutex = throat(1);
export const run = async (
globalConfig,
config,
environment,
runtime,
testPath
) => {
export const run = async (globalConfig, config, environment, runtime, testPath) => {
const CLITestRunner = {};
environment.global.addCLITestRunnerLogs = (logs) => {
environment.global.addCLITestRunnerLogs = logs => {
CLITestRunner.logs = logs;
};

environment.global.getRandomId = () => mutex(() => uuid.v4().split("-")[0]);
const result = await circusRunner(
globalConfig,
config,
environment,
runtime,
testPath
);
environment.global.getRandomId = () => mutex(() => uuid().split('-')[0]);
const result = await circusRunner(globalConfig, config, environment, runtime, testPath);
setTimeout(() => {
if (process.platform === "win32") {
if (process.platform === 'win32') {
// An issue with node-pty leaves open handles when running within jest
// This prevents the jest process from exiting without being forced.
// Exiting here as a workaround, only on windows.
Expand Down
4 changes: 2 additions & 2 deletions packages/amplify-e2e-core/src/nexpect-reporter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const fs = require('fs-extra');
const path = require('path');
const uuid = require('uuid');
const { v4: uuid } = require('uuid');
const localTemplatePath = path.resolve(__dirname, '../dist/index.html');

function imgToBase64(imgPath) {
Expand Down Expand Up @@ -72,7 +72,7 @@ class AmplifyCLIExecutionReporter {
const recordings = mergeCliLog(r, result.CLITestRunner.logs.children, r.ancestorTitles);

const recordingWithPath = recordings.map(r => {
const castFile = `${uuid.v4()}.cast`;
const castFile = `${uuid()}.cast`;
const castFilePath = path.join(publicPath, castFile);
fs.writeFileSync(castFilePath, r.recording);
const rCopy = { ...r };
Expand Down
2 changes: 1 addition & 1 deletion packages/amplify-migration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"graphql-transformer-core": "7.3.7",
"lodash": "^4.17.21",
"rimraf": "^3.0.0",
"uuid": "^8.2.0"
"uuid": "^8.3.2"
},
"jest": {
"verbose": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/amplify-storage-simulator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@types/etag": "^1.8.0",
"@types/glob": "^7.1.1",
"@types/serve-static": "^1.13.3",
"@types/uuid": "^3.4.7",
"@types/uuid": "^8.3.1",
"@types/xml": "^1.0.4",
"aws-sdk": "^2.963.0",
"request": "^2.88.0"
Expand Down