ci: verify chromedriver (#21993)
* initial pass * better * even better * ci * add chromedriver to build step * add chromedriver to other build step * persist chromedriver for tests * appveyor test * correct sys.platform names * chromedriver-path -> build-dir
This commit is contained in:
parent
1fb2b8e00e
commit
bdf65a75d0
3 changed files with 154 additions and 8 deletions
|
@ -477,6 +477,7 @@ step-persist-data-for-tests: &step-persist-data-for-tests
|
||||||
# Build artifacts
|
# Build artifacts
|
||||||
- src/out/Default/dist.zip
|
- src/out/Default/dist.zip
|
||||||
- src/out/Default/mksnapshot.zip
|
- src/out/Default/mksnapshot.zip
|
||||||
|
- src/out/Default/chromedriver.zip
|
||||||
- src/out/Default/shell_browser_ui_unittests
|
- src/out/Default/shell_browser_ui_unittests
|
||||||
- src/out/Default/gen/node_headers
|
- src/out/Default/gen/node_headers
|
||||||
- src/out/ffmpeg/ffmpeg.zip
|
- src/out/ffmpeg/ffmpeg.zip
|
||||||
|
@ -507,6 +508,13 @@ step-mksnapshot-unzip: &step-mksnapshot-unzip
|
||||||
cd src/out/Default
|
cd src/out/Default
|
||||||
unzip -o mksnapshot.zip
|
unzip -o mksnapshot.zip
|
||||||
|
|
||||||
|
step-chromedriver-unzip: &step-chromedriver-unzip
|
||||||
|
run:
|
||||||
|
name: Unzip chromedriver.zip
|
||||||
|
command: |
|
||||||
|
cd src/out/Default
|
||||||
|
unzip -o chromedriver.zip
|
||||||
|
|
||||||
step-ffmpeg-gn-gen: &step-ffmpeg-gn-gen
|
step-ffmpeg-gn-gen: &step-ffmpeg-gn-gen
|
||||||
run:
|
run:
|
||||||
name: ffmpeg GN gen
|
name: ffmpeg GN gen
|
||||||
|
@ -544,6 +552,13 @@ step-verify-mksnapshot: &step-verify-mksnapshot
|
||||||
cd src
|
cd src
|
||||||
python electron/script/verify-mksnapshot.py --source-root "$PWD" --build-dir out/Default
|
python electron/script/verify-mksnapshot.py --source-root "$PWD" --build-dir out/Default
|
||||||
|
|
||||||
|
step-verify-chromedriver: &step-verify-chromedriver
|
||||||
|
run:
|
||||||
|
name: Verify ChromeDriver
|
||||||
|
command: |
|
||||||
|
cd src
|
||||||
|
python electron/script/verify-chromedriver.py --source-root "$PWD" --build-dir out/Default
|
||||||
|
|
||||||
step-setup-linux-for-headless-testing: &step-setup-linux-for-headless-testing
|
step-setup-linux-for-headless-testing: &step-setup-linux-for-headless-testing
|
||||||
run:
|
run:
|
||||||
name: Setup for headless testing
|
name: Setup for headless testing
|
||||||
|
@ -965,6 +980,10 @@ steps-electron-build: &steps-electron-build
|
||||||
- *step-maybe-cross-arch-snapshot
|
- *step-maybe-cross-arch-snapshot
|
||||||
- *step-maybe-cross-arch-snapshot-store
|
- *step-maybe-cross-arch-snapshot-store
|
||||||
|
|
||||||
|
# chromedriver
|
||||||
|
- *step-electron-chromedriver-build
|
||||||
|
- *step-electron-chromedriver-store
|
||||||
|
|
||||||
# ffmpeg
|
# ffmpeg
|
||||||
- *step-ffmpeg-gn-gen
|
- *step-ffmpeg-gn-gen
|
||||||
- *step-ffmpeg-build
|
- *step-ffmpeg-build
|
||||||
|
@ -1144,6 +1163,18 @@ steps-verify-mksnapshot: &steps-verify-mksnapshot
|
||||||
- *step-verify-mksnapshot
|
- *step-verify-mksnapshot
|
||||||
- *step-maybe-notify-slack-failure
|
- *step-maybe-notify-slack-failure
|
||||||
|
|
||||||
|
steps-verify-chromedriver: &steps-verify-chromedriver
|
||||||
|
steps:
|
||||||
|
- attach_workspace:
|
||||||
|
at: .
|
||||||
|
- *step-depot-tools-add-to-path
|
||||||
|
- *step-electron-dist-unzip
|
||||||
|
- *step-chromedriver-unzip
|
||||||
|
- *step-setup-linux-for-headless-testing
|
||||||
|
|
||||||
|
- *step-verify-chromedriver
|
||||||
|
- *step-maybe-notify-slack-failure
|
||||||
|
|
||||||
steps-tests: &steps-tests
|
steps-tests: &steps-tests
|
||||||
steps:
|
steps:
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
|
@ -1152,6 +1183,7 @@ steps-tests: &steps-tests
|
||||||
- *step-depot-tools-add-to-path
|
- *step-depot-tools-add-to-path
|
||||||
- *step-electron-dist-unzip
|
- *step-electron-dist-unzip
|
||||||
- *step-mksnapshot-unzip
|
- *step-mksnapshot-unzip
|
||||||
|
- *step-chromedriver-unzip
|
||||||
- *step-setup-linux-for-headless-testing
|
- *step-setup-linux-for-headless-testing
|
||||||
- *step-restore-brew-cache
|
- *step-restore-brew-cache
|
||||||
- *step-fix-known-hosts-linux
|
- *step-fix-known-hosts-linux
|
||||||
|
@ -1185,6 +1217,7 @@ steps-tests: &steps-tests
|
||||||
path: src/junit
|
path: src/junit
|
||||||
|
|
||||||
- *step-verify-mksnapshot
|
- *step-verify-mksnapshot
|
||||||
|
- *step-verify-chromedriver
|
||||||
|
|
||||||
- *step-maybe-notify-slack-failure
|
- *step-maybe-notify-slack-failure
|
||||||
|
|
||||||
|
@ -1374,6 +1407,10 @@ commands:
|
||||||
- *step-maybe-cross-arch-snapshot
|
- *step-maybe-cross-arch-snapshot
|
||||||
- *step-maybe-cross-arch-snapshot-store
|
- *step-maybe-cross-arch-snapshot-store
|
||||||
|
|
||||||
|
# chromedriver
|
||||||
|
- *step-electron-chromedriver-build
|
||||||
|
- *step-electron-chromedriver-store
|
||||||
|
|
||||||
# ffmpeg
|
# ffmpeg
|
||||||
- *step-ffmpeg-gn-gen
|
- *step-ffmpeg-gn-gen
|
||||||
- *step-ffmpeg-build
|
- *step-ffmpeg-build
|
||||||
|
@ -1918,6 +1955,14 @@ jobs:
|
||||||
<<: *env-send-slack-notifications
|
<<: *env-send-slack-notifications
|
||||||
<<: *steps-verify-mksnapshot
|
<<: *steps-verify-mksnapshot
|
||||||
|
|
||||||
|
linux-x64-verify-chromedriver:
|
||||||
|
<<: *machine-linux-medium
|
||||||
|
environment:
|
||||||
|
<<: *env-linux-medium
|
||||||
|
<<: *env-headless-testing
|
||||||
|
<<: *env-send-slack-notifications
|
||||||
|
<<: *steps-verify-chromedriver
|
||||||
|
|
||||||
linux-ia32-testing-tests:
|
linux-ia32-testing-tests:
|
||||||
<<: *machine-linux-medium
|
<<: *machine-linux-medium
|
||||||
environment:
|
environment:
|
||||||
|
@ -1973,6 +2018,14 @@ jobs:
|
||||||
<<: *env-send-slack-notifications
|
<<: *env-send-slack-notifications
|
||||||
<<: *steps-verify-mksnapshot
|
<<: *steps-verify-mksnapshot
|
||||||
|
|
||||||
|
linux-ia32-verify-chromedriver:
|
||||||
|
<<: *machine-linux-medium
|
||||||
|
environment:
|
||||||
|
<<: *env-linux-medium
|
||||||
|
<<: *env-headless-testing
|
||||||
|
<<: *env-send-slack-notifications
|
||||||
|
<<: *steps-verify-chromedriver
|
||||||
|
|
||||||
osx-testing-tests:
|
osx-testing-tests:
|
||||||
<<: *machine-mac-large
|
<<: *machine-mac-large
|
||||||
environment:
|
environment:
|
||||||
|
@ -2003,6 +2056,13 @@ jobs:
|
||||||
<<: *env-send-slack-notifications
|
<<: *env-send-slack-notifications
|
||||||
<<: *steps-verify-mksnapshot
|
<<: *steps-verify-mksnapshot
|
||||||
|
|
||||||
|
osx-verify-chromedriver:
|
||||||
|
<<: *machine-mac
|
||||||
|
environment:
|
||||||
|
<<: *env-machine-mac
|
||||||
|
<<: *env-send-slack-notifications
|
||||||
|
<<: *steps-verify-chromedriver
|
||||||
|
|
||||||
mas-testing-tests:
|
mas-testing-tests:
|
||||||
<<: *machine-mac-large
|
<<: *machine-mac-large
|
||||||
environment:
|
environment:
|
||||||
|
@ -2033,6 +2093,13 @@ jobs:
|
||||||
<<: *env-send-slack-notifications
|
<<: *env-send-slack-notifications
|
||||||
<<: *steps-verify-mksnapshot
|
<<: *steps-verify-mksnapshot
|
||||||
|
|
||||||
|
mas-verify-chromedriver:
|
||||||
|
<<: *machine-mac
|
||||||
|
environment:
|
||||||
|
<<: *env-machine-mac
|
||||||
|
<<: *env-send-slack-notifications
|
||||||
|
<<: *steps-verify-chromedriver
|
||||||
|
|
||||||
# Layer 4: Summary.
|
# Layer 4: Summary.
|
||||||
linux-x64-release-summary:
|
linux-x64-release-summary:
|
||||||
<<: *machine-linux-medium
|
<<: *machine-linux-medium
|
||||||
|
@ -2220,15 +2287,19 @@ workflows:
|
||||||
- linux-x64-release-tests:
|
- linux-x64-release-tests:
|
||||||
requires:
|
requires:
|
||||||
- linux-x64-release
|
- linux-x64-release
|
||||||
|
- linux-x64-chromedriver:
|
||||||
|
requires:
|
||||||
|
- linux-checkout-fast
|
||||||
- linux-x64-verify-ffmpeg:
|
- linux-x64-verify-ffmpeg:
|
||||||
requires:
|
requires:
|
||||||
- linux-x64-release
|
- linux-x64-release
|
||||||
- linux-x64-verify-mksnapshot:
|
- linux-x64-verify-mksnapshot:
|
||||||
requires:
|
requires:
|
||||||
- linux-x64-release
|
- linux-x64-release
|
||||||
- linux-x64-chromedriver:
|
- linux-x64-verify-chromedriver:
|
||||||
requires:
|
requires:
|
||||||
- linux-checkout-fast
|
- linux-x64-release
|
||||||
|
- linux-x64-chromedriver
|
||||||
- linux-x64-release-summary:
|
- linux-x64-release-summary:
|
||||||
requires:
|
requires:
|
||||||
- linux-x64-release
|
- linux-x64-release
|
||||||
|
@ -2242,15 +2313,19 @@ workflows:
|
||||||
- linux-ia32-release-tests:
|
- linux-ia32-release-tests:
|
||||||
requires:
|
requires:
|
||||||
- linux-ia32-release
|
- linux-ia32-release
|
||||||
|
- linux-ia32-chromedriver:
|
||||||
|
requires:
|
||||||
|
- linux-checkout-fast
|
||||||
- linux-ia32-verify-ffmpeg:
|
- linux-ia32-verify-ffmpeg:
|
||||||
requires:
|
requires:
|
||||||
- linux-ia32-release
|
- linux-ia32-release
|
||||||
- linux-ia32-verify-mksnapshot:
|
- linux-ia32-verify-mksnapshot:
|
||||||
requires:
|
requires:
|
||||||
- linux-ia32-release
|
- linux-ia32-release
|
||||||
- linux-ia32-chromedriver:
|
- linux-x64-verify-chromedriver:
|
||||||
requires:
|
requires:
|
||||||
- linux-checkout-fast
|
- linux-ia32-release
|
||||||
|
- linux-ia32-chromedriver
|
||||||
- linux-ia32-release-summary:
|
- linux-ia32-release-summary:
|
||||||
requires:
|
requires:
|
||||||
- linux-ia32-release
|
- linux-ia32-release
|
||||||
|
@ -2299,15 +2374,19 @@ workflows:
|
||||||
- osx-release-tests:
|
- osx-release-tests:
|
||||||
requires:
|
requires:
|
||||||
- osx-release
|
- osx-release
|
||||||
|
- osx-chromedriver:
|
||||||
|
requires:
|
||||||
|
- mac-checkout-fast
|
||||||
- osx-verify-ffmpeg:
|
- osx-verify-ffmpeg:
|
||||||
requires:
|
requires:
|
||||||
- osx-release
|
- osx-release
|
||||||
- osx-verify-mksnapshot:
|
- osx-verify-mksnapshot:
|
||||||
requires:
|
requires:
|
||||||
- osx-release
|
- osx-release
|
||||||
- osx-chromedriver:
|
- osx-verify-chromedriver:
|
||||||
requires:
|
requires:
|
||||||
- mac-checkout-fast
|
- osx-release
|
||||||
|
- osx-chromedriver
|
||||||
- osx-release-summary:
|
- osx-release-summary:
|
||||||
requires:
|
requires:
|
||||||
- osx-release
|
- osx-release
|
||||||
|
@ -2321,15 +2400,19 @@ workflows:
|
||||||
- mas-release-tests:
|
- mas-release-tests:
|
||||||
requires:
|
requires:
|
||||||
- mas-release
|
- mas-release
|
||||||
|
- mas-chromedriver:
|
||||||
|
requires:
|
||||||
|
- mac-checkout-fast
|
||||||
- mas-verify-ffmpeg:
|
- mas-verify-ffmpeg:
|
||||||
requires:
|
requires:
|
||||||
- mas-release
|
- mas-release
|
||||||
- mas-verify-mksnapshot:
|
- mas-verify-mksnapshot:
|
||||||
requires:
|
requires:
|
||||||
- mas-release
|
- mas-release
|
||||||
- mas-chromedriver:
|
- mas-verify-chromedriver:
|
||||||
requires:
|
requires:
|
||||||
- mac-checkout-fast
|
- mas-release
|
||||||
|
- mas-chromedriver
|
||||||
- mas-release-summary:
|
- mas-release-summary:
|
||||||
requires:
|
requires:
|
||||||
- mas-release
|
- mas-release
|
||||||
|
|
|
@ -190,6 +190,8 @@ test_script:
|
||||||
- echo "About to verify mksnapshot"
|
- echo "About to verify mksnapshot"
|
||||||
- if "%RUN_TESTS%"=="true" ( echo Verifying mksnapshot & python electron\script\verify-mksnapshot.py --build-dir out\Default --source-root %cd% )
|
- if "%RUN_TESTS%"=="true" ( echo Verifying mksnapshot & python electron\script\verify-mksnapshot.py --build-dir out\Default --source-root %cd% )
|
||||||
- echo "Done verifying mksnapshot"
|
- echo "Done verifying mksnapshot"
|
||||||
|
- if "%RUN_TESTS%"=="true" ( echo Verifying chromedriver & python electron\script\verify-chromedriver.py --build-dir out\Default --source-root %cd% )
|
||||||
|
- echo "Done verifying chromedriver"
|
||||||
deploy_script:
|
deploy_script:
|
||||||
- cd electron
|
- cd electron
|
||||||
- ps: >-
|
- ps: >-
|
||||||
|
|
61
script/verify-chromedriver.py
Normal file
61
script/verify-chromedriver.py
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import os
|
||||||
|
import re
|
||||||
|
import shlex
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
import time
|
||||||
|
|
||||||
|
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
args = parse_args()
|
||||||
|
|
||||||
|
chromedriver_name = {
|
||||||
|
'darwin': 'chromedriver',
|
||||||
|
'win32': 'chromedriver.exe',
|
||||||
|
'linux2': 'chromedriver'
|
||||||
|
}
|
||||||
|
|
||||||
|
chromedriver_path = os.path.join(
|
||||||
|
args.source_root, args.build_dir, chromedriver_name[sys.platform])
|
||||||
|
proc = subprocess.Popen([chromedriver_path],
|
||||||
|
stdout=subprocess.PIPE, universal_newlines=True)
|
||||||
|
try:
|
||||||
|
output = proc.stdout.readline()
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
returncode = 0
|
||||||
|
finally:
|
||||||
|
proc.terminate()
|
||||||
|
|
||||||
|
returncode = 0
|
||||||
|
match = re.search(
|
||||||
|
'^Starting ChromeDriver [0-9]+.[0-9]+.[0-9]+.[0-9]+ .* on port [0-9]+$', output)
|
||||||
|
|
||||||
|
if match == None:
|
||||||
|
returncode = 1
|
||||||
|
|
||||||
|
if returncode == 0:
|
||||||
|
print('ok ChromeDriver is able to be initialized.')
|
||||||
|
|
||||||
|
return returncode
|
||||||
|
|
||||||
|
|
||||||
|
def parse_args():
|
||||||
|
parser=argparse.ArgumentParser(description='Test ChromeDriver')
|
||||||
|
parser.add_argument('--source-root',
|
||||||
|
default=SOURCE_ROOT,
|
||||||
|
required=False)
|
||||||
|
parser.add_argument('--build-dir',
|
||||||
|
default=None,
|
||||||
|
required=True)
|
||||||
|
return parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.exit(main())
|
Loading…
Add table
Add a link
Reference in a new issue