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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add development server e2e for gatsby #721

Merged
merged 3 commits into from
Jan 29, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/workflows/e2e-gatsby-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- master
pull_request:
paths:
- .github/workflows/e2e-eslint-workflow.yml
- .github/workflows/e2e-gatsby-workflow.yml
- scripts/e2e-setup-ci.sh

name: 'E2E Gatsby'
Expand All @@ -30,5 +30,13 @@ jobs:
- name: 'Running the integration test'
run: |
source scripts/e2e-setup-ci.sh
yarn dlx gatsby new my-gatsby && cd my-gatsby

yarn dlx gatsby new my-gatsby
cd my-gatsby

# Test production build
yarn build

# Test development server (which includes development only loaders like eslint-loader)
# Redirect the output to log.txt and check if it contains "ERROR #"
yarn dlx start-server-and-test "yarn start > log.txt 2>&1" :8000 "! cat log.txt | grep \"ERROR #\""
6 changes: 3 additions & 3 deletions .github/workflows/e2e-rollup-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:

yarn rollup -c
[[ "$(node dist/bundle.js)" = "125" ]]
cat dist/bundle.js | grep -v "square"
! cat dist/bundle.js | grep "square"

rm -rf dist src

Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
echo "import answer from 'the-answer'; import _ from 'lodash';" | tee src/main.js

yarn rollup -c
cat dist/bundle.js | grep -v "lodash"
! cat dist/bundle.js | grep "lodash"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL ! applies to the whole pipe in Bash, not only the command that follows 馃

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yah I couldn't find any doc on this either. I just tried it. Hope that I haven't encounter any edge case 馃槄


rm -rf src dist

Expand All @@ -102,7 +102,7 @@ jobs:

yarn rollup -c
[[ "$(node dist/bundle.js)" = "the answer is 42" ]]
cat dist/bundle.js | grep -v "console.log(\`"
! cat dist/bundle.js | grep "console.log(\`"

rm -rf src dist

Expand Down