Skip to content

Commit

Permalink
tests: fix ToT chrome install path (#15753)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamraine authored Jan 12, 2024
1 parent db20475 commit f8a16b7
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
basics:
runs-on: ubuntu-latest
env:
CHROME_PATH: ${{ github.workspace }}/.tmp/chrome-tot/chrome
FORCE_COLOR: true

# A few steps are duplicated across all jobs. Can be done better when this feature lands:
Expand All @@ -25,7 +26,6 @@ jobs:
fetch-depth: 100
- run: bash core/scripts/github-actions-commit-range.sh
env:
CHROME_PATH: ${{ github.workspace }}/lighthouse/.tmp/chrome-tot/chrome
GITHUB_CONTEXT_PR_BASE_SHA: ${{ github.event.pull_request.base.sha }}
GITHUB_CONTEXT_BASE_SHA: ${{ github.event.before }}

Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
fail-fast: false
runs-on: ubuntu-latest
env:
CHROME_PATH: ${{ github.workspace }}/.tmp/chrome-tot/chrome
# The total number of shards. Set dynamically when length of *single* matrix variable is
# computable. See https://github.community/t/get-length-of-strategy-matrix-or-get-all-matrix-options/18342
SHARD_TOTAL: 3
Expand All @@ -40,10 +41,6 @@ jobs:
with:
node-version: 18.x

- name: Define ToT chrome path
if: matrix.chrome-channel == 'ToT'
run: echo "CHROME_PATH=${{ github.workspace }}/lighthouse/.tmp/chrome-tot/chrome" >> $GITHUB_ENV

# Chrome Stable is already installed by default.
- name: Install Chrome ToT
if: matrix.chrome-channel == 'ToT'
Expand Down Expand Up @@ -95,7 +92,7 @@ jobs:
node-version: 18.x

- name: Define ToT chrome path
run: echo "CHROME_PATH=${env:GITHUB_WORKSPACE}\chrome-win\chrome.exe" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
run: echo "CHROME_PATH=${env:GITHUB_WORKSPACE}\.tmp\chrome-tot\chrome.exe" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append

# Chrome Stable is already installed by default.
- name: Install Chrome ToT
Expand Down Expand Up @@ -126,7 +123,7 @@ jobs:
fail-fast: false
runs-on: ubuntu-latest
env:
CHROME_PATH: ${{ github.workspace }}/lighthouse/.tmp/chrome-tot/chrome
CHROME_PATH: ${{ github.workspace }}/.tmp/chrome-tot/chrome
# The total number of shards. Set dynamically when length of *single* matrix variable is
# computable. See https://github.community/t/get-length-of-strategy-matrix-or-get-all-matrix-options/18342
SHARD_TOTAL: 3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
name: node ${{ matrix.node }}
env:
CHROME_PATH: ${{ github.workspace }}/lighthouse/.tmp/chrome-tot/chrome
CHROME_PATH: ${{ github.workspace }}/.tmp/chrome-tot/chrome
LATEST_NODE: '18'
FORCE_COLOR: true

Expand Down
17 changes: 17 additions & 0 deletions core/scripts/download-chrome.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,21 @@ curl "$url" -Lo chrome.zip && unzip -q chrome.zip && rm chrome.zip
mv * "$chrome_out"
cd - && rm -rf .tmp-download

echo "OUTPUT DIR: $chrome_out"
ls "$chrome_out"

echo "";
echo "Verifying CHROME_PATH...";

if ! [ -f $CHROME_PATH ]; then
echo "CHROME_PATH does not point to a valid file"
exit 1
else
echo "CHROME_PATH is good!"
fi

# TODO: Find a convenient way to check the version in windows
if [ "$machine" != "MinGw" ]; then
echo "CHROME_PATH version:"
$CHROME_PATH --version
fi

0 comments on commit f8a16b7

Please sign in to comment.