1#!/bin/bash 2# Copyright (C) 2019 The Android Open Source Project 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15 16source $(dirname ${BASH_SOURCE[0]})/common.sh 17 18export CI=1 19 20infra/perfetto.dev/build 21 22ui/build --out ${OUT_PATH} 23 24cp -a ${OUT_PATH}/ui/dist/ /ci/artifacts/ui 25 26ui/run-unittests --out ${OUT_PATH} --no-build 27 28set +e 29 30# Install chrome 31( 32 mkdir /ci/ramdisk/chrome 33 cd /ci/ramdisk/chrome 34 CHROME_VERSION=128.0.6613.137 35 curl -Ls -o chrome.deb https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}-1_amd64.deb 36 dpkg-deb -x chrome.deb . 37) 38ui/run-integrationtests --out ${OUT_PATH} --no-build 39RES=$? 40 41set +x 42 43# Copy the output of screenshots diff testing. 44if [ -d ${OUT_PATH}/ui-test-artifacts ]; then 45 cp -a ${OUT_PATH}/ui-test-artifacts /ci/artifacts/ui-test-artifacts 46 echo "UI integration test report with screnshots:" 47 echo "https://storage.googleapis.com/perfetto-ci-artifacts/$PERFETTO_TEST_JOB/ui-test-artifacts/index.html" 48 echo "" 49 echo "To download locally the changed screenshots run:" 50 echo "tools/download_changed_screenshots.py $PERFETTO_TEST_JOB" 51 echo "" 52 echo "Perfetto UI build for this CL" 53 echo "https://storage.googleapis.com/perfetto-ci-artifacts/$PERFETTO_TEST_JOB/ui/index.html" 54 exit $RES 55fi 56