-
Notifications
You must be signed in to change notification settings - Fork 515
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* switching to playwright * wip * wip * wip * lots of work ahead * wip * rename * auth wip * wip * progress * use --rootDir * change rootdir * wip * wip * install-deps * try this * kumascript tests * ignore accordingly * wip * wip * CONTENT_ROOT * CONTENT_ROOT * debugging * debugging * debugging * try this * debugging * debugging * debugging * debugging * correct browser name * correct browser name * config file * hopefully make tests a bit more reliable * tidying up some more * tidying up more * simplifying more * hopefully a bit better * start on the search page * yarn lock update * rewrite README about testing * networkidle
- Loading branch information
Showing
33 changed files
with
1,149 additions
and
1,306 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,21 +19,19 @@ jobs: | |
uses: actions/[email protected] | ||
with: | ||
node-version: "12" | ||
cache: "yarn" | ||
|
||
- name: Cache node_modules | ||
uses: actions/[email protected] | ||
id: cached-node_modules | ||
with: | ||
path: | | ||
node_modules | ||
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }} | ||
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}-${{ hashFiles('.github/workflows/developing.yml') }} | ||
|
||
- name: Install all yarn packages | ||
if: steps.cached-node_modules.outputs.cache-hit != 'true' | ||
env: | ||
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1 | ||
run: | | ||
yarn --frozen-lockfile | ||
run: yarn --frozen-lockfile | ||
|
||
- name: Setup kernel for react native, increase watchers | ||
run: | | ||
|
@@ -72,11 +70,9 @@ jobs: | |
# This will make sure the tests in `testing/tests/*.test.js` only run | ||
# if the development server is up and ready to be tested. | ||
TESTING_DEVELOPING: true | ||
# Use local chrome installs since we skip downloading it as part | ||
# of the yarn installs above | ||
PUPPETEER_EXECUTABLE_PATH: /usr/bin/google-chrome | ||
CONTENT_ROOT: mdn/content/files | ||
run: | | ||
yarn test:testing developing | ||
yarn test:developing | ||
- name: Debug server's stdout and stderr if tests failed | ||
if: failure() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,19 +24,18 @@ jobs: | |
uses: actions/[email protected] | ||
with: | ||
node-version: "12" | ||
cache: "yarn" | ||
|
||
- name: Cache node_modules | ||
uses: actions/[email protected] | ||
id: cached-node_modules | ||
with: | ||
path: | | ||
node_modules | ||
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }} | ||
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}-${{ hashFiles('.github/workflows/npm-published-simulation.yml') }} | ||
|
||
- name: Install all yarn packages | ||
if: steps.cached-node_modules.outputs.cache-hit != 'true' | ||
env: | ||
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1 | ||
run: yarn --frozen-lockfile | ||
|
||
- name: Setup kernel for react native, increase watchers | ||
|
@@ -87,16 +86,19 @@ jobs: | |
# This will make sure the tests in `testing/tests/*.test.js` only run | ||
# if the development server is up and ready to be tested. | ||
TESTING_DEVELOPING: true | ||
# Use local chrome installs since we skip downloading it as part | ||
# of the yarn installs above | ||
PUPPETEER_EXECUTABLE_PATH: /usr/bin/google-chrome | ||
# When running Yari from within mdn/content it only starts 1 server; | ||
# the one on localhost:5000. No React dev server; the one | ||
# on localhost:3000. | ||
# Testing that dev server is not relevant or important in this context. | ||
DEVELOPING_SKIP_DEV_URL: true | ||
CONTENT_ROOT: mdn/content/files | ||
run: | | ||
yarn test:developing | ||
- name: SSR build a page | ||
working-directory: mdn/content | ||
run: | | ||
yarn test:testing developing | ||
yarn build files/en-us/mdn/kitchensink/index.html | ||
- name: Debug server's stdout and stderr if tests failed | ||
if: failure() | ||
|
@@ -106,8 +108,3 @@ jobs: | |
echo "" | ||
echo "STDERR..................................................." | ||
cat /tmp/stderr.log | ||
- name: SSR build a page | ||
working-directory: mdn/content | ||
run: | | ||
yarn build files/en-us/mdn/kitchensink/index.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,19 +20,18 @@ jobs: | |
uses: actions/[email protected] | ||
with: | ||
node-version: "12" | ||
cache: "yarn" | ||
|
||
- name: Cache node_modules | ||
uses: actions/[email protected] | ||
id: cached-node_modules | ||
with: | ||
path: | | ||
node_modules | ||
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }} | ||
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}-${{ hashFiles('.github/workflows/testing.yml') }} | ||
|
||
- name: Install all yarn packages | ||
if: steps.cached-node_modules.outputs.cache-hit != 'true' | ||
env: | ||
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1 | ||
run: | | ||
yarn --frozen-lockfile | ||
|
@@ -45,26 +44,27 @@ jobs: | |
- name: Unit testing client | ||
run: yarn test:client | ||
|
||
- name: Functional testing | ||
- name: Build and start server | ||
env: | ||
# Make this env var explicit for GitHub Actions because in local | ||
# dev/debug you're encouraged to start it yourself in a separate | ||
# terminal. | ||
TESTING_START_SERVER: true | ||
# Use local chrome installs since we skip downloading it as part | ||
# of the yarn installs above | ||
PUPPETEER_EXECUTABLE_PATH: /usr/bin/google-chrome | ||
ENV_FILE: testing/.env | ||
run: | | ||
# Needed for the puppeteer tests that start a static Express server, | ||
# but it starts it from within the testing/ path. | ||
echo "CONTENT_ROOT=content/files" >> .env | ||
yarn prepare-build | ||
yarn build | ||
yarn start:static-server > /tmp/stdout.log 2> /tmp/stderr.log & | ||
sleep 1 | ||
curl --retry-connrefused --retry 5 http://localhost:5000 > /dev/null | ||
# In terms of the --maxWorkers option, it's not yet clear which | ||
# is best. | ||
# See https://jestjs.io/docs/en/troubleshooting#tests-are-extremely-slow-on-docker-andor-continuous-integration-ci-server | ||
# and https://www.peterbe.com/plog/ideal-number-of-workers-in-jest-maxWorkers | ||
# CI tends to have fewer CPUs than laptops so let's stay conservative | ||
# for now. | ||
# Also note that `--runInBand` is the same as `--maxWorkers=1` | ||
- name: Functional testing | ||
run: | | ||
yarn test:testing | ||
yarn test:headless | ||
./testing/scripts/functional-test.sh --runInBand | ||
- name: Debug server's stdout and stderr if tests failed | ||
if: failure() | ||
run: | | ||
echo "STDOUT..................................................." | ||
cat /tmp/stdout.log | ||
echo "" | ||
echo "STDERR..................................................." | ||
cat /tmp/stderr.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.