From da0ac5b970365d2ffbad2a9955bf9163f52040b5 Mon Sep 17 00:00:00 2001 From: Matthias Winkelmann Date: Sat, 18 Mar 2017 08:13:41 +0100 Subject: [PATCH] Fix spurious opengl errrors --- Dockerfile | 20 +++----------------- lighthouse-chromium-xvfb.sh | 16 +++++++--------- 2 files changed, 10 insertions(+), 26 deletions(-) diff --git a/Dockerfile b/Dockerfile index aa5774f..781c12c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 @@ -36,7 +35,6 @@ ENV GEOMETRY "$SCREEN_WIDTH""x""$SCREEN_HEIGHT""x""$SCREEN_DEPTH" RUN echo $TZ > /etc/timezone - #----------------- # Add packages #----------------- @@ -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/* \ @@ -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 diff --git a/lighthouse-chromium-xvfb.sh b/lighthouse-chromium-xvfb.sh index 3317a90..1967a43 100755 --- a/lighthouse-chromium-xvfb.sh +++ b/lighthouse-chromium-xvfb.sh @@ -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 \ @@ -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 $@