Skip to content

Commit cb67ac9

Browse files
author
Illia Obukhau
committed
style(run-e2e): small cleanup
1 parent 7ea8efe commit cb67ac9

File tree

4 files changed

+17
-23
lines changed

4 files changed

+17
-23
lines changed

.github/workflows/WebAutomatedTests.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ concurrency:
1111
group: ${{ github.workflow }}-${{ github.ref }}
1212
cancel-in-progress: true
1313

14-
env:
15-
IS_NOT_FORK_PR: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'mendix/web-widgets' }}
16-
1714
jobs:
1815
harden-security:
1916
name: Check SHA in GH Actions
@@ -24,6 +21,7 @@ jobs:
2421
- uses: zgosalvez/github-actions-ensure-sha-pinned-actions@570fff1eb64d52ffae87990c117c2748c317b58c # v2.0.0
2522

2623
test:
24+
# Run job only if it's push to main or PR from web-widgets, don't run for fork PRs
2725
if: >-
2826
${{ github.event_name == 'push' ||
2927
github.event_name == 'pull_request' &&

automation/run-e2e/bin/run-e2e-in-chunks.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function main() {
4747
if (filters.length > 0) {
4848
execSync(command, { stdio: "inherit" });
4949
} else {
50-
console.log(c.cyan("No packages in chunk, skip e2e."));
50+
console.log(c.yellow("No packages in chunk, skip e2e."));
5151
}
5252
}
5353

automation/run-e2e/lib/ci.mjs

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@ import { setupTestProject } from "./setup-test-project.mjs";
1010
import { updateWidget } from "./utils.mjs";
1111

1212
const MX_VERSION_MAP_URL =
13+
// Remove after merge
1314
"https://raw.githubusercontent.com/mendix/widgets-resources/master/configs/e2e/mendix-versions.json";
14-
15-
// const MX_VERSION_MAP_URL =
16-
// "https://raw.githubusercontent.com/mendix/web-widgets/main/automation/run-e2e/mendix-versions.json";
15+
// Uncomment after merge
16+
// "https://raw.githubusercontent.com/mendix/web-widgets/main/automation/run-e2e/mendix-versions.json";
1717

1818
const { ls, cat } = sh;
1919

2020
export async function ci() {
21-
// assert.ok(process.env.CI, "This command meant to run in CI env");
2221
console.log(c.cyan("Run e2e tests in CI environment"));
2322

2423
const parseArgsOptions = {
@@ -31,7 +30,7 @@ export async function ci() {
3130
configuration: {
3231
// https://github.com/yargs/yargs-parser#boolean-negation
3332
"boolean-negation": true,
34-
// https://github.com/yargs/yargs-parser#boolean-negation
33+
// https://github.com/yargs/yargs-parser#camel-case-expansion
3534
"camel-case-expansion": true
3635
}
3736
};
@@ -94,19 +93,16 @@ async function getMendixVersion(options) {
9493
return process.env.MENDIX_VERSION;
9594
}
9695

97-
try {
98-
const versionMapResponse = await fetch(MX_VERSION_MAP_URL);
99-
if (versionMapResponse.ok) {
100-
const { mxVersion } = options;
101-
const versionMap = await versionMapResponse.json();
102-
if (mxVersion in versionMap) {
103-
return versionMap[mxVersion];
104-
}
105-
106-
return versionMap.latest;
96+
const versionMapResponse = await fetch(MX_VERSION_MAP_URL);
97+
if (versionMapResponse.ok) {
98+
const { mxVersion } = options;
99+
const versionMap = await versionMapResponse.json();
100+
if (mxVersion in versionMap) {
101+
return versionMap[mxVersion];
107102
}
108-
} catch (err) {
109-
console.err(err);
110-
throw new Error("Couldn't fetch mendix-versions.json");
103+
104+
return versionMap.latest;
105+
} else {
106+
throw new Error(`Couldn't fetch mendix-versions.json: ${versionMapResponse.statusText}`);
111107
}
112108
}

automation/run-e2e/lib/dev.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export async function dev() {
2020
configuration: {
2121
// https://github.com/yargs/yargs-parser#boolean-negation
2222
"boolean-negation": true,
23-
// https://github.com/yargs/yargs-parser#boolean-negation
23+
// https://github.com/yargs/yargs-parser#camel-case-expansion
2424
"camel-case-expansion": true
2525
}
2626
};

0 commit comments

Comments
 (0)