Skip to content

Commit

Permalink
chore: Resolve E2E test failures in forked repos (#15120)
Browse files Browse the repository at this point in the history
* improve

* Update scripts/integration-tests/utils/e2e-check.js

Co-authored-by: Nicol貌 Ribaudo <nicolo.ribaudo@gmail.com>

* review

* Update scripts/integration-tests/utils/e2e-check.js

Co-authored-by: Hu谩ng J霉nli脿ng <jlhwung@gmail.com>

* review

* review

* Update scripts/integration-tests/utils/e2e-check.js

Co-authored-by: Hu谩ng J霉nli脿ng <jlhwung@gmail.com>

Co-authored-by: Nicol貌 Ribaudo <nicolo.ribaudo@gmail.com>
Co-authored-by: Hu谩ng J霉nli脿ng <jlhwung@gmail.com>
  • Loading branch information
3 people committed Nov 4, 2022
1 parent 77f3700 commit a464616
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
11 changes: 11 additions & 0 deletions scripts/integration-tests/publish-local.sh
Expand Up @@ -25,6 +25,17 @@ initializeE2Egit

yarn

# Does not trap on error
node --experimental-fetch scripts/integration-tests/utils/e2e-check.js && :; ret=$?

if [ $ret -eq 10 ]; then
cleanup
exit 0
elif [ $ret -ne 0 ]; then
cleanup
exit 1
fi

startLocalRegistry "$PWD"/scripts/integration-tests/verdaccio-config.yml
loginLocalRegistry

Expand Down
21 changes: 21 additions & 0 deletions scripts/integration-tests/utils/e2e-check.js
@@ -0,0 +1,21 @@
import fs from "fs";

const resp = await fetch(
"https://raw.githubusercontent.com/babel/babel/main/package.json"
);
const mainRepoPackageJson = await resp.json();

if (
mainRepoPackageJson.version !==
JSON.parse(fs.readFileSync("package.json")).version
) {
if (process.env.GITHUB_REPOSITORY === "babel/babel") {
console.error("The branch is not up to date with main, please rebase");
process.exitCode = 1;
} else {
console.error(
"The branch is not up to date with main of babel/babel, skipping"
);
process.exitCode = 10;
}
}

0 comments on commit a464616

Please sign in to comment.