Skip to content

Commit f84dc77

Browse files
sobolkakshbhu
authored andcommitted
chore: run e2e tests on windows on node18 (aws-amplify#12370)
* chore: run e2e tests on windows on node18 * chore: fix build
1 parent d0262ee commit f84dc77

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

.circleci/config.base.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ parameters:
1616
executors:
1717
w_medium: &windows-e2e-executor-medium
1818
machine:
19-
image: 'windows-server-2019-vs2019:stable'
19+
image: 'windows-server-2022-gui:current'
2020
resource_class: 'windows.medium'
2121
shell: bash.exe
2222
working_directory: ~/repo
@@ -26,7 +26,7 @@ executors:
2626

2727
w_xlarge: &windows-e2e-executor-xlarge
2828
machine:
29-
image: 'windows-server-2019-vs2019:stable'
29+
image: 'windows-server-2022-gui:current'
3030
resource_class: 'windows.xlarge'
3131
shell: bash.exe
3232
working_directory: ~/repo
@@ -150,7 +150,7 @@ jobs:
150150
condition:
151151
equal: [*windows-e2e-executor-xlarge, << parameters.os >>]
152152
steps:
153-
- install_node14_windows
153+
- install_node_windows
154154
- checkout
155155
- run: yarn config set script-shell $(which bash)
156156
- run: yarn run production-build
@@ -471,7 +471,7 @@ jobs:
471471
condition:
472472
equal: [*windows-e2e-executor-medium, << parameters.os >>]
473473
steps:
474-
- install_node14_windows
474+
- install_node_windows
475475
- attach_workspace:
476476
at: ~/.
477477
- run:
@@ -1413,15 +1413,15 @@ commands:
14131413
exit 1
14141414
fi
14151415
when: always
1416-
install_node14_windows:
1417-
description: Install Node 14 on Windows
1416+
install_node_windows:
1417+
description: Install Node 18 on Windows
14181418
steps:
14191419
- run:
1420-
name: Install Node 14
1420+
name: Install Node 18
14211421
command: |
14221422
nvm version
1423-
nvm install 14.18
1424-
nvm use 14.18
1423+
nvm install 18.15.0
1424+
nvm use 18.15.0
14251425
nvm ls
14261426
- run:
14271427
name: Check Node, install yarn

packages/amplify-e2e-tests/src/__tests__/init_d.test.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
createNewProjectDir,
1111
deleteProjectDir,
1212
} from '@aws-amplify/amplify-e2e-core';
13+
import { isWindowsPlatform } from 'amplify-cli-core';
1314

1415
describe('amplify init d', () => {
1516
let projRoot: string;
@@ -32,7 +33,15 @@ describe('amplify init d', () => {
3233
const localEnvData = fs.readJsonSync(localEnvPath);
3334
const originalPath = localEnvData.projectPath;
3435

35-
expect(localEnvData.projectPath).toEqual(fs.realpathSync(projRoot));
36+
if (isWindowsPlatform()) {
37+
// The project dir created using os.tmpdir() has shortened C:\\Users\\CIRCLE~1.PAC\\ segment
38+
// but projectPath comes as C:\\Users\\circleci.PACKER-633B1A5A\\ for example
39+
// which is fine but makes comparison harder
40+
expect(path.isAbsolute(localEnvData.projectPath)).toBe(true);
41+
expect(fs.statSync(localEnvData.projectPath)).toEqual(fs.statSync(projRoot));
42+
} else {
43+
expect(localEnvData.projectPath).toEqual(fs.realpathSync(projRoot));
44+
}
3645

3746
localEnvData.projectPath = path.join('foo', 'bar');
3847

0 commit comments

Comments
 (0)