Skip to content

Commit

Permalink
Merge pull request #707 from krompaco/main
Browse files Browse the repository at this point in the history
Make Lighthouse/YLT/Pa11y work in GH Action Docker regression test
  • Loading branch information
7h3Rabbit authored Nov 9, 2024
2 parents 1fbca7e + 89d60be commit daddca6
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 63 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/regression-test-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,16 @@ jobs:
- name: Check if webperf_core can run Test 1
if: always()
run: |
testresult=$(docker run ${{ env.TEST_TAG }} python default.py -t 1 -r -i defaults/sites.json)
testresult=$(docker run --shm-size=4g -e MAX_OLD_SPACE_SIZE=3000 ${{ env.TEST_TAG }} python default.py -t 1 -r -i defaults/sites.json)
echo "$testresult"
if [[ "$testresult" == *"Unable to connect to Chrome"* ]]; then
sleep 5
testresult=$(docker run ${{ env.TEST_TAG }} python default.py -t 1 -r -i defaults/sites.json)
testresult=$(docker run --shm-size=4g -e MAX_OLD_SPACE_SIZE=3000 ${{ env.TEST_TAG }} python default.py -t 1 -r -i defaults/sites.json)
echo "$testresult"
fi
if [[ "$testresult" == *"Unable to connect to Chrome"* ]]; then
sleep 5
testresult=$(docker run ${{ env.TEST_TAG }} python default.py -t 1 -r -i defaults/sites.json)
testresult=$(docker run --shm-size=4g -e MAX_OLD_SPACE_SIZE=3000 ${{ env.TEST_TAG }} python default.py -t 1 -r -i defaults/sites.json)
echo "$testresult"
fi
if [[ "$testresult" == *"Error, was unable to load the page you requested"* ]]; then
Expand Down Expand Up @@ -211,7 +211,7 @@ jobs:
- name: Check if webperf_core can run Test 17
if: always()
run: |
testresult=$(docker run ${{ env.TEST_TAG }} python default.py -t 17 -r -i defaults/sites.json)
testresult=$(docker run --shm-size=4g -e MAX_OLD_SPACE_SIZE=3000 ${{ env.TEST_TAG }} python default.py -t 17 -r -i defaults/sites.json)
echo "$testresult"
if [[ "$testresult" != *"Integrity & Security:"* ]]; then
echo "Error: WebPerf-core testresult is NOT returning expected review"
Expand All @@ -220,7 +220,7 @@ jobs:
- name: Check if webperf_core can run Test 18
if: always()
run: |
testresult=$(docker run ${{ env.TEST_TAG }} python default.py -t 18 -r -i defaults/sites.json)
testresult=$(docker run --shm-size=4g -e MAX_OLD_SPACE_SIZE=3000 ${{ env.TEST_TAG }} python default.py -t 18 -r -i defaults/sites.json)
echo "$testresult"
if [[ "$testresult" != *"A11y:"* ]]; then
echo "Error: WebPerf-core testresult is NOT returning expected review"
Expand All @@ -247,16 +247,16 @@ jobs:
- name: Check if webperf_core can run Test 22
if: always()
run: |
testresult=$(docker run ${{ env.TEST_TAG }} python default.py -t 22 -r -i defaults/sites.json)
testresult=$(docker run --shm-size=4g -e MAX_OLD_SPACE_SIZE=3000 ${{ env.TEST_TAG }} python default.py -t 22 -r -i defaults/sites.json)
echo "$testresult"
if [[ "$testresult" == *"Unable to connect to Chrome"* ]]; then
sleep 5
testresult=$(docker run ${{ env.TEST_TAG }} python default.py -t 22 -r -i defaults/sites.json)
testresult=$(docker run --shm-size=4g -e MAX_OLD_SPACE_SIZE=3000 ${{ env.TEST_TAG }} python default.py -t 22 -r -i defaults/sites.json)
echo "$testresult"
fi
if [[ "$testresult" == *"Unable to connect to Chrome"* ]]; then
sleep 5
testresult=$(docker run ${{ env.TEST_TAG }} python default.py -t 22 -r -i defaults/sites.json)
testresult=$(docker run --shm-size=4g -e MAX_OLD_SPACE_SIZE=3000 ${{ env.TEST_TAG }} python default.py -t 22 -r -i defaults/sites.json)
echo "$testresult"
fi
if [[ "$testresult" == *"Error, was unable to load the page you requested"* ]]; then
Expand Down
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV DEBIAN_FRONTEND=noninteractive

# YLT/phantomas should pick this up and use --no-sandbox
ENV LAMBDA_TASK_ROOT=/trick/phantomas

RUN apt-get update &&\
apt-get install -y --no-install-recommends curl gcc g++ gnupg unixodbc-dev openssl git default-jre default-jdk && \
apt-get install -y software-properties-common ca-certificates && \
Expand Down Expand Up @@ -50,11 +53,17 @@ WORKDIR /usr/src/runner

RUN echo 'ALL ALL=NOPASSWD: /usr/sbin/tc, /usr/sbin/route, /usr/sbin/ip' > /etc/sudoers.d/tc

# https://github.com/puppeteer/puppeteer/issues/8148#issuecomment-1397528849
RUN Xvfb -ac :99 -screen 0 1280x1024x16 & export DISPLAY=:99

RUN npm install -g node-gyp puppeteer

# If own settings.json exists it will overwrite the default
COPY . /usr/src/runner

# Use same parameters YLT/phantomas
COPY pa11y-docker-config.json /usr/src/runner/pa11y.json

RUN chown --recursive sitespeedio:sitespeedio /usr/src/runner

# Run everything after as non-privileged user.
Expand Down
49 changes: 0 additions & 49 deletions credits.md

This file was deleted.

6 changes: 6 additions & 0 deletions pa11y-docker-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"chromeLaunchConfig": {
"ignoreHTTPSErrors": false,
"args": ["--no-sandbox", "--no-zygote", "--disable-gpu", "--single-process"]
}
}
6 changes: 0 additions & 6 deletions pally-config.json

This file was deleted.

0 comments on commit daddca6

Please sign in to comment.