Skip to content
This repository has been archived by the owner on Apr 12, 2018. It is now read-only.

Commit

Permalink
Fix spurious opengl errrors
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthiasWinkelmann committed Mar 18, 2017
1 parent f712f8e commit da0ac5b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 26 deletions.
20 changes: 3 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ USER root
RUN echo "http://dl-2.alpinelinux.org/alpine/edge/main" > /etc/apk/repositories
RUN echo "http://dl-2.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
RUN echo "http://dl-2.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
RUN echo "http://dl-2.alpinelinux.org/alpine/v3.2/main" >> /etc/apk/repositories

#-----------------
# Set ENV and change mode
Expand All @@ -36,7 +35,6 @@ ENV GEOMETRY "$SCREEN_WIDTH""x""$SCREEN_HEIGHT""x""$SCREEN_DEPTH"

RUN echo $TZ > /etc/timezone


#-----------------
# Add packages
#-----------------
Expand All @@ -48,26 +46,15 @@ RUN apk -U --no-cache add \
xvfb \
wait4ports \
xorg-server \
dbus-x11 \
dbus \
ttf-freefont \
mesa-dri-swrast \
git

# DEV Version of lighthouse
mesa-dri-swrast

RUN apk -U --no-cache add git
RUN git clone https://github.com/GoogleChrome/lighthouse.git
WORKDIR /lighthouse
RUN npm -g install yarn
RUN yarn install
RUN cd ./lighthouse-core && yarn install
RUN cd ./lighthouse-cli && yarn install && tsc
RUN npm run install-all && npm run build-all && npm link
RUN npm --global install yarn && yarn global add lighthouse

# Minimize size

RUN apk del --force curl make gcc g++ python linux-headers binutils-gold gnupg git
RUN apk del --purge --force curl make gcc g++ python linux-headers binutils-gold gnupg git zlib-dev apk-tools libc-utils

RUN rm -rf /var/lib/apt/lists/* \
/var/cache/apk/* \
Expand All @@ -78,7 +65,6 @@ RUN rm -rf /var/lib/apt/lists/* \
/usr/lib/node_modules/npm/html \
/usr/lib/node_modules/npm/scripts


ADD lighthouse-chromium-xvfb.sh /lighthouse/lighthouse-chromium-xvfb.sh

VOLUME /lighthouse/output
Expand Down
16 changes: 7 additions & 9 deletions lighthouse-chromium-xvfb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ export CHROME_DEBUGGING_PORT=9222
# Start Xvfb
Xvfb ${DISPLAY} -ac +iglx -screen 0 ${GEOMETRY} -nolisten tcp & xvfb=$!

printf "Starting xvfb window server"
printf "Starting xvfb window server..."

while [ 1 -gt $xvfb ]; do printf "waiting for Xvfb to start: $xvfb"; sleep 1; done
while [ 1 -gt $xvfb ]; do printf "..."; sleep 1; done

printf "xvfb started"
printf "xvfb started\n\n"

printf "Starting chromium, with debugger on port $CHROME_DEBUGGING_POST"
printf "Starting chromium, with debugger on port $CHROME_DEBUGGING_POST...\n\n"

# --disable-webgl \

Expand All @@ -51,18 +51,16 @@ chromium=$!

wait4ports tcp://127.0.0.1:$CHROME_DEBUGGING_PORT

printf "chromium started"

printf "launching lighthouse run"
printf "\n\n==============================\nlaunching lighthouse run\n==============================\n\n"

if [ "$testing" -eq "1" ]; then
lighthouse --skip-autolaunch --disable-cpu-throttling --output-path=/tmp/test-report.html --output=html https://google.com
if grep -q -F "Best Practice" /tmp/test-report*; then
printf "Test succeeded!";
printf "\n\n==============================\nTest succeeded!\n==============================\n";
return 0;
fi

printf "Test failed!";
printf "\n\n==============================\nTest failed!\n==============================\n";
return 1;
else
lighthouse $@
Expand Down

0 comments on commit da0ac5b

Please sign in to comment.