Skip to content

Commit 2e21691

Browse files
DSchaupieh
authored andcommitted
test: fix failing path prefix test by updating gatsby/cli version (#8362)
* test: fix failing path prefix test by updating gatsby/cli version This updates the internal gatsby version in one of the tests (path prefix) so that the `gatsby serve` command now has the option `--prefix-paths` which is required for the test to pass. To the best of my knowledge, the --copy-all behavior of gatsby-dev-cli isn't meaningful here, because it doesn't copy over the .bin executables, so the local package.json versions are still used for some things. Also note, for the chmod change, check out [this test run](https://circleci.com/gh/gatsbyjs/gatsby/1410). I've seen that happen locally after running gatsby-dev-cli, and that's the fix that's worked for me! * ci: don't hardcode gatsby path
1 parent f514b44 commit 2e21691

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

integration-tests/path-prefix/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"author": "Kyle Mathews <[email protected]>",
66
"dependencies": {
77
"cypress": "^3.1.0",
8-
"gatsby": "next",
8+
"gatsby": "^2.0.6",
99
"gatsby-plugin-manifest": "next",
1010
"gatsby-plugin-offline": "next",
1111
"gatsby-plugin-react-helmet": "next",

scripts/integration-test.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
#!/bin/bash
22
SRC_PATH=$1
33
CUSTOM_COMMAND="${2:-test}"
4-
GATSBY_PATH="/home/circleci/project"
4+
GATSBY_PATH="${CIRCLE_WORKING_DIRECTORY:-../../}"
55

66
sudo npm install -g gatsby-dev-cli &&
77

88
# setting up child integration test link to gatsby packages
99
cd $SRC_PATH &&
1010
yarn &&
1111
gatsby-dev --set-path-to-repo $GATSBY_PATH &&
12-
gatsby-dev --scan-once --copy-all && # copies _all_ files in gatsby/packages
12+
gatsby-dev --scan-once --copy-all --quiet && # copies _all_ files in gatsby/packages
13+
sudo chmod +x ./node_modules/.bin/gatsby && # this is sometimes necessary to ensure executable
1314
yarn $CUSTOM_COMMAND &&
1415
echo "Integration test run succeeded"

0 commit comments

Comments
 (0)