forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
1068 lines (1028 loc) · 53.9 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# This file is part of eyeo Chromium SDK,
# Copyright (C) 2006-present eyeo GmbH
# eyeo Chromium SDK is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
# eyeo Chromium SDK is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with eyeo Chromium SDK. If not, see <http://www.gnu.org/licenses/>.
variables:
PIPELINE_TYPE:
value: ""
description: "Default to run same pipeline we run for -dev branches. Full to run all jobs but performance tests. Custom when you want to set flags below."
options:
- ""
- "default"
- "full"
- "custom"
RUN_MOBILE_PERF_TESTS:
value: "false"
options:
- "true"
- "false"
description: "Set it to true to run mobile performance tests. This will run build_arm_apk_release job and trigger performance tests (memory and PLT)"
RUN_DESKTOP_PERF_TESTS:
value: "false"
options:
- "true"
- "false"
description: "Set it to true to run desktop performance tests. This will run build_linux_installer job and trigger performance tests (memory and PLT)"
RUN_DESKTOP_RELEASE_TEST_JOB:
value: "false"
options:
- "true"
- "false"
description: "Set it to true to build linux release and run unit,component and browser tests."
RUN_ANDROID_X64_DEBUG_JOB:
value: "false"
options:
- "true"
- "false"
description: "Set it to true to build android x64 debug and run unit,component and android tests."
RUN_ANDROID_X86_RELEASE_JOB:
value: "false"
options:
- "true"
- "false"
description: "Set it to true to build android x86 release, browser apk and webview."
RUN_ANDROID_ARM_APK_RELEASE_BUILD:
value: "false"
options:
- "true"
- "false"
description: "Set it to true to build android arm release browser apk."
RUN_ANDROID_ARM_APK_DEBUG_BUILD:
value: "false"
options:
- "true"
- "false"
description: "Set it to true to build android arm debug browser apk."
RUN_ANDROID_ARM_WEBVIEW_RELEASE_BUILD:
value: "false"
options:
- "true"
- "false"
description: "Set it to true to build android arm release webview."
RUN_APPIUM_TESTS:
value: "false"
options:
- "true"
- "false"
description: "Set it to true to run x64 build + tests and complete appium test suite."
RUN_SELENIUM_TESTS:
value: "false"
options:
- "true"
- "false"
description: "Set it to true to run linux installer and complete selenium test suite."
RUN_WINDOWS_JOBS:
value: "false"
options:
- "true"
- "false"
description: "Set it to true to build windows debug and release"
RUN_VERIFY_FLATBUFFER_ADBLOCKING:
value: "skip"
options:
- "skip"
- "10k"
- "full"
description: "Scope for filtering rules verification"
RUN_MAC_OS_RELEASE_BUILD:
value: "false"
options:
- "true"
- "false"
description: "Set it to true to build mac(m1) release and run unit,component and browser tests."
RUN_UPDATE_BADGES:
value: "false"
options:
- "true"
- "false"
description: "Scheduled job to update badges for default branch"
workflow:
rules:
# Avoid duplicate pipelines when pushing to a branch that has an open MR
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push"
when: never
- if: $CI_MERGE_REQUEST_IID
- if: $PIPELINE_TYPE == "full"
variables:
RUN_ALL_TESTS: "true"
RUN_ALL_E2E_TESTS: "true"
# Release branch pipelines include all jobs but performance tests, since those run only for tags.
- if: $CI_COMMIT_BRANCH =~ /^eyeo-[0-9]+-beta$/ || $CI_COMMIT_BRANCH =~ /^eyeo-[0-9]+-rc$/
variables:
PIPELINE_TYPE: "full"
RUN_VERIFY_FLATBUFFER_ADBLOCKING: "10k"
- if: '$CI_COMMIT_BRANCH =~ /-vanilla-automated$/'
- if: $CI_COMMIT_TAG
- if: '$CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "web"'
- if: '$PIPELINE_TYPE == "custom" || $PIPELINE_TYPE == "default"'
stages:
- build_linux
- build_x86_android
- build_x64_android
- build_arm_android_chrome
- build_arm_android_webview
- end_to_end_tests
- performance_tests
- build_windows
- build_mac
- module_generation
- update_badges
### Rules ###
# Due to the number of jobs and different pipelines configuration the project have,
# we've created two sets of different rules used to modify the default behavior of each job.
.rules_for_vanilla:
rules:
generic:
- if: '$CI_COMMIT_BRANCH =~ /-vanilla-automated$/'
performance_tests:
- if: '$TRIGGER_PERF_TEST == "true" && $CI_COMMIT_BRANCH =~ /-vanilla-automated$/'
# Rules for running full pipeline for eyeo-chromium-sdk branches
.rules_for_eyeo_chromium_jobs:
rules:
always_run_job_for_full_pipeline:
- if: '$PIPELINE_TYPE == "full"'
when: always
only_on_success_for_full_pipeline:
- if: '$PIPELINE_TYPE == "full"'
on_success_for_full_scheduled_pipeline:
- if: $PIPELINE_TYPE == "full" && $CI_PIPELINE_SOURCE == "schedule"
run_for_mrs:
- if: $CI_MERGE_REQUEST_IID
variables:
CHROMIUM_BRANCH: ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}
manual_job_for_mrs:
- if: $CI_MERGE_REQUEST_IID
variables:
CHROMIUM_BRANCH: ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}
when: manual
allow_failure: true
run_for_tags:
# Use commit tag as CHROMIUM_BRANCH if tests are running from a tag.
- if: $CI_COMMIT_TAG
variables:
CHROMIUM_BRANCH: ${$CI_COMMIT_TAG}
.rules_for_custom_pipelines:
rules:
default_run:
- if: $PIPELINE_TYPE == "default"
default_run_manual:
- if: $PIPELINE_TYPE == "default"
when: manual
allow_failure: true
run_mobile_perf_tests:
- if: '$RUN_MOBILE_PERF_TESTS == "true"'
run_desktop_perf_tests:
- if: '$RUN_DESKTOP_PERF_TESTS == "true"'
run_windows_jobs:
- if: '$RUN_WINDOWS_JOBS == "true"'
run_desktop_release_test_job:
- if: '$RUN_DESKTOP_RELEASE_TEST_JOB == "true"'
run_android_x64_debug_job:
- if: '$RUN_ANDROID_X64_DEBUG_JOB == "true"'
run_android_x86_release_job:
- if: '$RUN_ANDROID_X86_RELEASE_JOB == "true"'
run_android_arm_apk_release_build:
- if: '$RUN_ANDROID_ARM_APK_RELEASE_BUILD == "true"'
run_android_arm_apk_debug_build:
- if: '$RUN_ANDROID_ARM_APK_DEBUG_BUILD == "true"'
run_android_arm_webview_release_build:
- if: '$RUN_ANDROID_ARM_WEBVIEW_RELEASE_BUILD == "true"'
run_selenium_tests:
- if: '$RUN_SELENIUM_TESTS == "true"'
variables:
RUN_ALL_E2E_TESTS: "true"
run_appium_tests:
- if: '$RUN_APPIUM_TESTS == "true"'
variables:
RUN_ALL_E2E_TESTS: "true"
run_mac_os_release_build:
- if: '$RUN_MAC_OS_RELEASE_BUILD == "true"'
.rules_for_module_testing_pipeline:
rules:
scheduled_run:
- if: '$RUN_MODULE_TESTING == "true"'
#### Chromium job template configuration ####
.configure_linux_gclient: &configure_linux_gclient
- rm -f ../.gclient*
- cp gclient/.gclient_ci_linux ../.gclient
.configure_android_gclient: &configure_android_gclient
- rm -f ../.gclient*
- cp gclient/.gclient_ci_android ../.gclient
.configure_windows_gclient: &configure_windows_gclient
- rm -f ../.gclient*
- cp gclient/.gclient_ci_windows ../.gclient
.configure_mac_gclient: &configure_mac_gclient
- rm -f ../.gclient*
- cp gclient/.gclient_ci_mac ../.gclient
# Workaround to avoid issues when fetching code
# TODO: Remove it whenever gitlab issues are fixed (DPD-2025)
.set_git_to_use_ssh: &set_git_to_use_ssh
- apt-get update && apt-get -qy install openssh-client
- eval $(ssh-agent -s)
- test -d ~/.ssh/ || mkdir --mode=0700 ~/.ssh/
- ssh-keyscan gitlab.com >> ~/.ssh/known_hosts
- echo "${chromium_bot_ssh_key}" | ssh-add -
- git remote set-url origin git@$CI_SERVER_HOST:$CI_PROJECT_PATH.git
.common_build_chromium_before: &common_build_chromium_before
- git config --global --add safe.directory /opt/ci/chromium-sdk/src
- chown -R non_root:non_root /opt/ $GIT_CACHE_PATH .. ~
- source .ci-scripts/install_packages.sh
# Setup depot tools path. Export in Dockerfile using .bashrc does not work, hence it is added here before 1st use.
- export PATH=$PATH:$DEPOT_TOOLS
# Pull the dependencies in root directory and return to the src folder.
- cd ..; runuser -p -u non_root -- time gclient sync --force --reset --delete_unversioned_trees | grep -v '=='; cd src
# To use most recent version of goma, start it after depot-tools is up-to-date
- runuser -p -u non_root -- time goma_ctl ensure_start
- export PATH=`pwd`/third_party/llvm-build/Release+Asserts/bin:$PATH
# Populate some info shown in chrome://version
- LAST_CHANGE="${CI_COMMIT_SHORT_SHA}-${CI_JOB_NAME}-${CI_JOB_ID}"
- echo LASTCHANGE="${LAST_CHANGE}" > build/util/LASTCHANGE
.mac_build_common:
tags:
- macos
dependencies: []
interruptible: true
variables:
GIT_CLONE_PATH: $CI_BUILDS_DIR/chromium-sdk/src
GIT_CACHE_PATH: $MAC_WORK_DIR/.gclient_git_cache
GOMA_SERVER_PORT: 443
GOMACTL_USE_PROXY: "false"
NUMJOBS: 150
before_script:
- *configure_mac_gclient
- cd ..; time gclient sync --force --reset --delete_unversioned_trees | grep -v '=='; cd src
- time goma_ctl ensure_start
# Populate some info shown in chrome://version
- LAST_CHANGE="${CI_COMMIT_SHORT_SHA}-${CI_JOB_NAME}-${CI_JOB_ID}"
- echo LASTCHANGE="${LAST_CHANGE}" > build/util/LASTCHANGE
rules:
- !reference [.rules_for_eyeo_chromium_jobs, rules, always_run_job_for_full_pipeline]
- !reference [.rules_for_custom_pipelines, rules, run_mac_os_release_build]
- !reference [.rules_for_eyeo_chromium_jobs, rules, manual_job_for_mrs]
.common_build_chromium:
image: "registry.gitlab.com/eyeo/docker/chromium-sdk_gitlab-runner:202212.1"
tags:
- "distpartners-build-server-1-chromium-sdk-builder"
dependencies: []
interruptible: true
variables:
GIT_CLONE_PATH: $CI_BUILDS_DIR/chromium-sdk/src
GIT_CACHE_PATH: "/gclient_git_cache"
GOMA_SERVER_PORT: 443
GOMACTL_USE_PROXY: "false"
DEPOT_TOOLS_WIN_TOOLCHAIN: 1
NUMJOBS: 150
before_script:
- *configure_android_gclient
- *common_build_chromium_before
after_script:
- chown root:root /root/.cache/pip
# archive to minio
- /artifact-archiver/bootstrap.sh
.windows_build_common:
extends: .common_build_chromium
stage: build_windows
needs: []
before_script:
# Download currently required toolchain
- python3 ${GIT_CLONE_PATH}/.ci-scripts/minio_download_files.py chromium-sdk-win-toolchains 67d4679251.zip
- export GYP_MSVS_HASH_27370823e7=67d4679251
# Chromium Windows Vars
- export DEPOT_TOOLS_WIN_TOOLCHAIN_BASE_URL=`pwd`
- *configure_windows_gclient
# Disable local idle compiling to avoid issues when building
- export GOMA_USE_LOCAL="false"
- *common_build_chromium_before
# Hardcode value missing by lack of git history
- echo 1647554189 > build/util/LASTCHANGE.committime
rules:
- !reference [.rules_for_eyeo_chromium_jobs, rules, manual_job_for_mrs]
- !reference [.rules_for_eyeo_chromium_jobs, rules, always_run_job_for_full_pipeline]
- !reference [.rules_for_custom_pipelines, rules, default_run_manual]
- !reference [.rules_for_custom_pipelines, rules, run_windows_jobs]
artifacts:
expire_in: 1 day
paths:
- "out/Win/mini_installer.exe"
- "out/Win/eyeometry_test_server.7z" # Will only work if ! ${RUN_FOR_MODULE} == "true"
- "out/Win/eyeo_benchmarks.7z"
when: always
.fail_if_pipeline_not_triggered: &fail_if_pipeline_not_triggered
- if [ $(cat response.json | jq -r ".status") != "created" ]; then
echo "Error. Pipeline was not triggered";
exit 1;
fi
#### Jobs definition ####
build_and_test_x64_debug:
extends: .common_build_chromium
stage: build_x64_android
script:
- if [[ ${WEEKLY_PIPELINE} == "true" ]]; then
DISABLE_FIELDTRIAL_TESTING_CONFIG=" disable_fieldtrial_testing_config=false ";
CLANG_CFI_CONFIG=" is_cfi=true use_cfi_icall=true use_cfi_cast=true use_cfi_diag=true use_thin_lto=true ";
else
DISABLE_FIELDTRIAL_TESTING_CONFIG=" disable_fieldtrial_testing_config=true ";
CLANG_CFI_CONFIG=" is_cfi=false ";
fi
- runuser -p -u non_root -- time gn gen --check --args='target_cpu="x64" use_goma=true enable_nacl=false target_os="android" is_debug=true proprietary_codecs=true ffmpeg_branding="Chrome" eyeo_intercept_debug_url=true'"${DISABLE_FIELDTRIAL_TESTING_CONFIG} eyeo_telemetry_activeping_auth_token=\"${TELEMETRY_DEFAULT_SERVER_ACTIVEPING_AUTH_TOKEN}\" ${GN_EXTRA_ARGS_INTERNAL} ${GN_EXTRA_ARGS} ${CLANG_CFI_CONFIG}" out/Debug
- BUILD_TARGETS="chrome_public_apk unit_tests components_unittests chrome_public_test_apk components_perftests system_webview_apk system_webview_shell_apk "
- if [[ ${PIPELINE_TYPE} == "full" && ${CI_PIPELINE_SOURCE} == "schedule" ]] || [[ ${RUN_FOR_WEBVIEW_MODULE} == "true" ]]; then
BUILD_TARGETS+=" webview_instrumentation_test_apk ";
fi
- if [[ ! ${RUN_FOR_MODULE} == "true" ]]; then
BUILD_TARGETS+=" verify_flatbuffer_adblocking ";
fi
- runuser -p -u non_root -- time ninja -j${NUMJOBS} -C out/Debug ${BUILD_TARGETS}
- runuser -p -u non_root -- time goma_ctl stat
- time ./out/Debug/bin/run_unit_tests --avd-config tools/android/avd/proto/generic_android31.textpb -v -f "*Abp*:*Adblock*" --gtest_output="xml:/data/user/0/org.chromium.native_test/unit_tests_report.xml" --app-data-file-dir out/Debug/
- time ./out/Debug/bin/run_components_unittests --avd-config tools/android/avd/proto/generic_android31.textpb -v -f "*Abp*:*Adblock*" --gtest_output="xml:/data/user/0/org.chromium.native_test/components_unittests_report.xml" --app-data-file-dir out/Debug/
- tools/android/avd/avd.py start --avd-config tools/android/avd/proto/generic_android31.textpb --wipe-data
- time ./out/Debug/bin/run_chrome_public_test_apk -v -A Feature=adblock
- if [[ ${PIPELINE_TYPE} == "full" && ${CI_PIPELINE_SOURCE} == "schedule" ]] || [[ ${RUN_FOR_WEBVIEW_MODULE} == "true" ]]; then
time ./out/Debug/bin/run_webview_instrumentation_test_apk --avd-config tools/android/avd/proto/generic_android31.textpb -v -A Feature=adblock;
fi
rules:
- !reference [.rules_for_eyeo_chromium_jobs, rules, always_run_job_for_full_pipeline]
- !reference [.rules_for_eyeo_chromium_jobs, rules, run_for_mrs]
- !reference [.rules_for_custom_pipelines, rules, default_run]
- !reference [.rules_for_custom_pipelines, rules, run_appium_tests]
- !reference [.rules_for_custom_pipelines, rules, run_android_x64_debug_job]
artifacts:
expire_in: 1 day
paths:
- "./out/Debug/apks/ChromePublic.apk"
- "./out/Debug/TEST_RESULTS*"
# # Will only work if [ ! ${RUN_FOR_MODULE} == "true" ]
- "./out/Debug/bin/system_webview_apk"
- "./out/Debug/bin/system_webview_shell_apk"
- "./out/Debug/apks/SystemWebView.apk"
- "./out/Debug/apks/SystemWebViewShell.apk"
# TODO (DPD-1508)
# reports:
# junit:
# - "out/Debug/emulator-*/unit_tests_report.xml"
# - "out/Debug/emulator-*/components_unittests_report.xml"
when: always
build_and_test_desktop_release:
extends: .common_build_chromium
stage: build_linux
needs: []
before_script:
- *configure_linux_gclient
- *common_build_chromium_before
script:
# cpplint step is disabled because of DPD-2150. It should be restored once we fix the 524 errors.
# - |
# BRANCH="$CI_MERGE_REQUEST_TARGET_BRANCH_NAME";
# if [ ! -z "$BRANCH" ]; then
# echo "Lint will run for cpp files modified against $BRANCH";
# git fetch origin $BRANCH
# FILES_TO_CHECK=$(git diff-tree --no-commit-id --name-only -r $CI_COMMIT_SHA origin/$BRANCH -- '*.cc' '*.h')
# if [ ! -z "$FILES_TO_CHECK" ]; then
# # Muted some lint checks which produce false positives (runtime/references) or lot of noise.
# LINT_OUTPUT=$(cpplint.py --filter=-whitespace,-build/include_what_you_use,-runtime/references $FILES_TO_CHECK 2>&1) || true;
# echo "Lint output:";
# echo "$LINT_OUTPUT";
# if [[ $LINT_OUTPUT == *"Do not include .cc files from other packages"* ]]; then
# echo "Included .cc file instead of a header file!";
# exit 1;
# fi
# fi
# fi
- if [[ ${WEEKLY_PIPELINE} == "true" ]]; then
DISABLE_FIELDTRIAL_TESTING_CONFIG=" disable_fieldtrial_testing_config=false ";
CLANG_CFI_CONFIG=" is_cfi=true use_cfi_icall=true use_cfi_cast=true use_cfi_diag=true use_thin_lto=true ";
else
DISABLE_FIELDTRIAL_TESTING_CONFIG=" disable_fieldtrial_testing_config=true ";
CLANG_CFI_CONFIG=" is_cfi=false";
fi
- runuser -p -u non_root -- time gn gen --check --args='is_debug=false use_goma=true enable_nacl=false proprietary_codecs=true ffmpeg_branding="Chrome" eyeo_application_name="app_name_from_ci_config" eyeo_application_version="app_version_from_ci_config"'"${DISABLE_FIELDTRIAL_TESTING_CONFIG} eyeo_telemetry_activeping_auth_token=\"${TELEMETRY_DEFAULT_SERVER_ACTIVEPING_AUTH_TOKEN}\" ${GN_EXTRA_ARGS_INTERNAL} ${GN_EXTRA_ARGS} ${GN_SCHEDULE_DEFAULT_PIPELINE_ARGS} ${CLANG_CFI_CONFIG}" out/Release
- BUILD_TARGETS="chrome unit_tests components_unittests browser_tests chrome_sandbox"
- if [[ ! ${RUN_FOR_MODULE} == "true" ]]; then
BUILD_TARGETS+=" verify_flatbuffer_adblocking ";
fi
- runuser -p -u non_root -- time ninja -j${NUMJOBS} -C out/Release ${BUILD_TARGETS}
- export BUILDTYPE=Release
- export CHROME_DEVEL_SANDBOX=/usr/local/sbin/chrome-devel-sandbox
- runuser -p -u non_root -- time build/update-linux-sandbox.sh
- runuser -p -u non_root -- time goma_ctl stat
# Verify adblocking logic against reference results on a very small set
# of URLs as a sanity check. See verify_flatbuffer_adblocking stage for
# full test.
- if [[ ! ${RUN_FOR_MODULE} == "true" ]]; then
time ./out/Release/verify_flatbuffer_adblocking;
fi
# Run all tests when PIPELINE_TYPE is set to full otherwise only our tests.
- |
if [[ $RUN_ALL_TESTS == "true" ]]; then
# Get list of failed tests to exclude from vanilla branch with the same major version number.
export VERSION=`./out/Release/chrome --product-version`;
export DOWNLOAD_DIR="test_reports";
python3 ${GIT_CLONE_PATH}/.ci-scripts/get_vanilla_job_test_report.py ${VERSION} ${DOWNLOAD_DIR};
if [ -s "${DOWNLOAD_DIR}/out/Release/unit_tests_failed.txt" ]; then
# Exclude tests that failed in vanilla.
EXCLUSION_FILTER=`python3 ${GIT_CLONE_PATH}/.ci-scripts/get_gtest_exclusion_filter.py ${DOWNLOAD_DIR}/out/Release/unit_tests_failed.txt`;
runuser -p -u non_root -- time xvfb-run ./out/Release/bin/run_unit_tests --gtest_output="xml:out/Release/unit_tests_report.xml" --gtest_filter="${EXCLUSION_FILTER}";
else
runuser -p -u non_root -- time xvfb-run ./out/Release/bin/run_unit_tests --gtest_output="xml:out/Release/unit_tests_report.xml";
fi
if [ -s "${DOWNLOAD_DIR}/out/Release/components_unittests_failed.txt" ]; then
# Exclude tests that failed in vanilla.
EXCLUSION_FILTER=`python3 ${GIT_CLONE_PATH}/.ci-scripts/get_gtest_exclusion_filter.py ${DOWNLOAD_DIR}/out/Release/components_unittests_failed.txt`;
runuser -p -u non_root -- time xvfb-run ./out/Release/bin/run_components_unittests --gtest_output="xml:out/Release/components_unittests_report.xml" --gtest_filter="${EXCLUSION_FILTER}";
else
runuser -p -u non_root -- time xvfb-run ./out/Release/bin/run_components_unittests --gtest_output="xml:out/Release/components_unittests_report.xml";
fi
if [ -s "${DOWNLOAD_DIR}/out/Release/browser_tests_failed.txt" ]; then
# Exclude tests that failed in vanilla.
EXCLUSION_FILTER=`python3 ${GIT_CLONE_PATH}/.ci-scripts/get_gtest_exclusion_filter.py ${DOWNLOAD_DIR}/out/Release/browser_tests_failed.txt`;
runuser -p -u non_root -- time xvfb-run -s "-screen 0 1024x768x24" out/Release/bin/run_browser_tests --gtest_output="xml:out/Release/browser_tests_report.xml" --test-launcher-jobs=12 --no-sandbox --gtest_filter="${EXCLUSION_FILTER}" | grep -v -e "error [0-9]\+.*Bad";
else
runuser -p -u non_root -- time xvfb-run -s "-screen 0 1024x768x24" out/Release/bin/run_browser_tests --gtest_output="xml:out/Release/browser_tests_report.xml" --test-launcher-jobs=12 --no-sandbox | grep -v -e "error [0-9]\+.*Bad";
fi
else
# This is a MR pipeline so just run our custom tests.
runuser -p -u non_root -- time xvfb-run ./out/Release/bin/run_unit_tests --gtest_output="xml:out/Release/unit_tests_report.xml" --gtest_filter="*Adblock*:*Eyeo*";
runuser -p -u non_root -- time xvfb-run ./out/Release/bin/run_components_unittests --gtest_output="xml:out/Release/components_unittests_report.xml" --gtest_filter="*Adblock*:*Eyeo*";
runuser -p -u non_root -- time xvfb-run -s "-screen 0 1024x768x24" out/Release/bin/run_browser_tests --gtest_output="xml:out/Release/browser_tests_report.xml" --test-launcher-jobs=12 --no-sandbox --gtest_filter="*Adblock*:*Eyeo*" | grep -v -e "error [0-9]\+.*Bad";
fi
rules:
- !reference [.rules_for_eyeo_chromium_jobs, rules, always_run_job_for_full_pipeline]
- !reference [.rules_for_eyeo_chromium_jobs, rules, run_for_mrs]
- !reference [.rules_for_custom_pipelines, rules, default_run]
- !reference [.rules_for_custom_pipelines, rules, run_desktop_release_test_job]
artifacts:
expire_in: 1 week
reports:
junit:
- "out/Release/unit_tests_report.xml"
- "out/Release/components_unittests_report.xml"
- "out/Release/browser_tests_report.xml"
when: always
build_linux_installer_release:
extends: .common_build_chromium
stage: build_linux
needs: []
before_script:
- *configure_linux_gclient
- *common_build_chromium_before
script:
# is_official_build=false is due to DPD-2064, it's a workaround. is_official_build should be true for performance tests.
- runuser -p -u non_root -- time gn gen --check --args='disable_fieldtrial_testing_config=true proprietary_codecs=true ffmpeg_branding="Chrome" use_goma=true enable_nacl=false is_component_build=false is_debug=false eyeo_intercept_debug_url=true is_official_build=false chrome_pgo_phase = 0 '"eyeo_telemetry_activeping_auth_token=\"${TELEMETRY_DEFAULT_SERVER_ACTIVEPING_AUTH_TOKEN}\" ${GN_EXTRA_ARGS_INTERNAL} ${GN_EXTRA_ARGS}" out/Release
- BUILD_TARGETS="chrome/installer/linux:unstable_deb "
- if [[ ! ${RUN_FOR_MODULE} == "true" ]]; then
BUILD_TARGETS+=" archive_eyeometry_test_server archive_eyeo_benchmarks ";
fi
- runuser -p -u non_root -- time ninja -j${NUMJOBS} -C out/Release ${BUILD_TARGETS}
- runuser -p -u non_root -- time goma_ctl stat
rules:
- !reference [.rules_for_eyeo_chromium_jobs, rules, always_run_job_for_full_pipeline]
- !reference [.rules_for_eyeo_chromium_jobs, rules, run_for_mrs]
- !reference [.rules_for_eyeo_chromium_jobs, rules, run_for_tags]
- !reference [.rules_for_custom_pipelines, rules, default_run]
- !reference [.rules_for_custom_pipelines, rules, run_desktop_perf_tests]
- !reference [.rules_for_custom_pipelines, rules, run_selenium_tests]
artifacts:
expire_in: 1 day
paths:
- "out/Release/*.deb"
- "out/Release/eyeometry_test_server.7z" # Will only work if ! ${RUN_FOR_MODULE} == "true"
- "out/Release/eyeo_benchmarks.7z"
verify_flatbuffer_adblocking:
extends: .common_build_chromium
stage: build_linux
before_script:
- *configure_linux_gclient
- *common_build_chromium_before
script:
- '[[ $RUN_VERIFY_FLATBUFFER_ADBLOCKING == "10k" ]] && VERIFY_SOURCE="random_shuf_100000.tsv.sql" || VERIFY_SOURCE="7M_requests.tsv.sql"'
- python3 ${GIT_CLONE_PATH}/.ci-scripts/minio_download_files.py chromium-sdk-test-assets $VERIFY_SOURCE
# Build the verify_flatbuffer_adblocking target and run it with the downloaded input database
- runuser -p -u non_root -- time gn gen --args='disable_fieldtrial_testing_config=true is_debug=false use_goma=true enable_nacl=false symbol_level=1 proprietary_codecs=true ffmpeg_branding="Chrome" clang_use_default_sample_profile = false is_cfi = false' out/Release_desktop
- runuser -p -u non_root -- ninja -C out/Release_desktop/ verify_flatbuffer_adblocking
- runuser -p -u non_root -- time goma_ctl stat
- time ./out/Release_desktop/verify_flatbuffer_adblocking --input=$VERIFY_SOURCE 2>&1 | tee verification_result.txt
rules:
- if: '$RUN_VERIFY_FLATBUFFER_ADBLOCKING == "10k" || $RUN_VERIFY_FLATBUFFER_ADBLOCKING == "full"'
when: always
artifacts:
expire_in: 1 week
paths:
- "verification_result.txt"
reports:
metrics: verification_result.txt
selenium_desktop_tests:
stage: end_to_end_tests
needs: ["build_linux_installer_release"]
dependencies: ["build_linux_installer_release"]
tags:
- docker
image: "registry.gitlab.com/eyeo/docker/pipeline-trigger:2.7.1"
variables:
CHROMIUM_BRANCH: ${CI_COMMIT_BRANCH}
GIT_STRATEGY: "none"
TESTING_BRANCH: "main"
TESTING_PROJECT_ID: "34109517" #https://gitlab.com/eyeo/distpartners/eyeo-chromium-desktop-test-automation
before_script:
- apk update
# Install jq to parse the API response later
- apk add jq
# Update wget to prevent issues with TLS handshake (DPD-830)
- apk add wget
- pip3 install minio
script:
# Get eyeo Chromium SDK file name
- cd out/Release ; CHROMIUM_FILENAME=$(ls *deb) ; cd $CI_PROJECT_DIR
- echo "Testing $CHROMIUM_FILENAME"
# Download script to get pre-signed URL for artifacts used in the test
- wget $CI_PROJECT_URL/raw/$CI_COMMIT_SHA/.ci-scripts/minio_get_presigned_url.py
# Get URL for the linux installer
- "export BUILD_JOB_ID=$(wget --header \"PRIVATE-TOKEN: ${CHROMIUM_GITLAB_COM_TOKEN}\" -O - ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/pipelines/${CI_PIPELINE_ID}/jobs | jq -c '.[] | select(.name == (\"build_linux_installer_release\")) | .id' | sort | tail -1)"
- export MINIO_OBJECT="${CI_PROJECT_PATH}/${CI_PIPELINE_ID}/${BUILD_JOB_ID}/out/Release/${CHROMIUM_FILENAME}"
- "export CHROMIUM_FILE_URL=$(python3 minio_get_presigned_url.py ${CI_PROJECT_NAME} ${MINIO_OBJECT})"
- echo "Pre-signed URL with 1 day expiration is ${CHROMIUM_FILE_URL}"
# Start the pipeline and wait for it to finish
- trigger --api-token ${GITLAB_COM_TOKEN}
--pipeline-token ${DOWNSTREAM_DESKTOP_TESTING_TOKEN}
--target-ref $TESTING_BRANCH
--env CHROMIUM_FILE=${CHROMIUM_FILE_URL}
--env CHROMIUM_GIT_SHA=${CI_COMMIT_SHORT_SHA}
--env RUN_FULL_SUITE=${RUN_ALL_E2E_TESTS}
--env CHROMIUM_BRANCH=${CHROMIUM_BRANCH}
${TESTING_PROJECT_ID} | tee pipeline
# Use the API to download and extract the junit test results
- "export PIPELINE_ID=$(grep 'Pipeline created (id:' pipeline | sed 's/[^0-9]*//g')"
- "export JOB_ID=$(wget --header \"PRIVATE-TOKEN: ${GITLAB_COM_TOKEN}\" -O - https://gitlab.com/api/v4/projects/${TESTING_PROJECT_ID}/pipelines/${PIPELINE_ID}/jobs | jq .[0].id)"
- "wget --header \"PRIVATE-TOKEN: ${GITLAB_COM_TOKEN}\" https://gitlab.com/api/v4/projects/${TESTING_PROJECT_ID}/jobs/${JOB_ID}/artifacts"
- "unzip artifacts"
rules:
- !reference [.rules_for_eyeo_chromium_jobs, rules, only_on_success_for_full_pipeline]
- !reference [.rules_for_eyeo_chromium_jobs, rules, run_for_mrs]
- !reference [.rules_for_custom_pipelines, rules, default_run]
- !reference [.rules_for_custom_pipelines, rules, run_selenium_tests]
artifacts:
expire_in: 6 months
reports:
junit: "$CI_PROJECT_DIR/target/cucumber-reports/*.xml"
appium_device_tests:
stage: end_to_end_tests
needs: ["build_and_test_x64_debug"]
tags:
- docker
image: "registry.gitlab.com/eyeo/docker/pipeline-trigger:2.7.1"
variables:
CHROMIUM_BRANCH: ${CI_COMMIT_BRANCH}
GIT_STRATEGY: "none"
TESTING_BRANCH: "main"
TESTING_PROJECT_ID: "14347317" # https://gitlab.com/eyeo/distpartners/eyeo-chromium-test-automation
before_script:
- apk update
# Install jq to parse the API response later
- apk add jq
# Update wget to prevent issues with TLS handshake (DPD-830)
- apk add wget
# Remove files to make sure volumes are cleaned before starting the tests
- rm -rf *
- pip3 install minio
script:
# Download script to get pre-signed URL for artifacts used in the test
- wget $CI_PROJECT_URL/raw/$CI_COMMIT_SHA/.ci-scripts/minio_get_presigned_url.py
# Get URL for APK
- "export BUILD_JOB_ID=$(wget --header \"PRIVATE-TOKEN: ${CHROMIUM_GITLAB_COM_TOKEN}\" -O - ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/pipelines/${CI_PIPELINE_ID}/jobs | jq -c '.[] | select(.name == (\"build_and_test_x64_debug\")) | .id' | sort | tail -1)"
- export MINIO_OBJECT="${CI_PROJECT_PATH}/${CI_PIPELINE_ID}/${BUILD_JOB_ID}/out/Debug/apks/ChromePublic.apk"
- "export APK_URL=$(python3 minio_get_presigned_url.py ${CI_PROJECT_NAME} ${MINIO_OBJECT})"
- echo "Pre-signed URL with 1 day expiration is ${APK_URL}"
# Start the pipeline and wait for it to finish
- trigger --api-token ${GITLAB_COM_TOKEN}
--pipeline-token ${DOWNSTREAM_TESTING_TOKEN}
--target-ref $TESTING_BRANCH
--env APK_X86=${APK_URL}
--env APK_GIT_SHA=${CI_COMMIT_SHORT_SHA}
--env RUN_FULL_SUITE=${RUN_ALL_E2E_TESTS}
--env CHROMIUM_BRANCH=${CHROMIUM_BRANCH}
${TESTING_PROJECT_ID} | tee pipeline
# Use the API to download and extract the junit test results
- "export PIPELINE_ID=$(grep 'Pipeline created (id:' pipeline | sed 's/[^0-9]*//g')"
- "export JOB_ID=$(wget --header \"PRIVATE-TOKEN: ${GITLAB_COM_TOKEN}\" -O - https://gitlab.com/api/v4/projects/${TESTING_PROJECT_ID}/pipelines/${PIPELINE_ID}/jobs | jq .[0].id)"
- "wget --header \"PRIVATE-TOKEN: ${GITLAB_COM_TOKEN}\" https://gitlab.com/api/v4/projects/${TESTING_PROJECT_ID}/jobs/${JOB_ID}/artifacts"
- "unzip artifacts"
rules:
- !reference [.rules_for_eyeo_chromium_jobs, rules, only_on_success_for_full_pipeline]
- !reference [.rules_for_eyeo_chromium_jobs, rules, run_for_mrs]
- !reference [.rules_for_custom_pipelines, rules, default_run]
- !reference [.rules_for_custom_pipelines, rules, run_appium_tests]
artifacts:
expire_in: 6 months
reports:
junit: "target/cucumber-reports/*.xml"
build_x86_release:
extends: .common_build_chromium
stage: build_x86_android
script:
- runuser -p -u non_root -- time gn gen --check --args='target_cpu="x86" eyeo_intercept_debug_url=true disable_fieldtrial_testing_config=true target_os="android" proprietary_codecs=true is_official_build=true use_goma=true enable_nacl=false is_debug=false ffmpeg_branding="Chrome" symbol_level=1 '"eyeo_telemetry_activeping_auth_token=\"${TELEMETRY_DEFAULT_SERVER_ACTIVEPING_AUTH_TOKEN}\" ${GN_EXTRA_ARGS_INTERNAL} ${GN_EXTRA_ARGS}" out/Release
- runuser -p -u non_root -- time ninja -j${NUMJOBS} -C out/Release chrome_public_apk system_webview_apk system_webview_shell_apk
- runuser -p -u non_root -- time goma_ctl stat
rules:
- !reference [.rules_for_custom_pipelines, rules, run_android_x86_release_job]
artifacts:
expire_in: 1 day
paths:
- "./out/Release/apks/ChromePublic.apk"
- "./out/Release/bin/system_webview_apk"
- "./out/Release/bin/system_webview_shell_apk"
- "./out/Release/apks/SystemWebView.apk"
- "./out/Release/apks/SystemWebViewShell.apk"
when: always
build_arm_apk_release:
extends: .common_build_chromium
stage: build_arm_android_chrome
needs: []
script:
- runuser -p -u non_root -- time gn gen --check --args='disable_fieldtrial_testing_config=true target_os="android" proprietary_codecs=true is_official_build=true use_goma=true enable_nacl=false is_debug=false ffmpeg_branding="Chrome" symbol_level=1 '"eyeo_telemetry_activeping_auth_token=\"${TELEMETRY_DEFAULT_SERVER_ACTIVEPING_AUTH_TOKEN}\" ${GN_EXTRA_ARGS_INTERNAL} ${GN_EXTRA_ARGS}" out/Release
- runuser -p -u non_root -- time ninja -j${NUMJOBS} -C out/Release chrome_public_apk
- runuser -p -u non_root -- time goma_ctl stat
rules:
- !reference [.rules_for_eyeo_chromium_jobs, rules, only_on_success_for_full_pipeline]
- !reference [.rules_for_eyeo_chromium_jobs, rules, run_for_mrs]
- !reference [.rules_for_eyeo_chromium_jobs, rules, run_for_tags]
- !reference [.rules_for_vanilla, rules, generic]
- !reference [.rules_for_custom_pipelines, rules, run_mobile_perf_tests]
- !reference [.rules_for_custom_pipelines, rules, default_run]
- !reference [.rules_for_custom_pipelines, rules, run_android_arm_apk_release_build]
artifacts:
expire_in: 1 day
paths:
- ./out/Release/apks/ChromePublic.apk
build_arm_apk_debug:
extends: .common_build_chromium
stage: build_arm_android_chrome
needs: []
script:
- runuser -p -u non_root -- time gn gen --check --args='disable_fieldtrial_testing_config=true target_os="android" is_debug=true proprietary_codecs=true use_goma=true enable_nacl=false ffmpeg_branding="Chrome" '"eyeo_telemetry_activeping_auth_token=\"${TELEMETRY_DEFAULT_SERVER_ACTIVEPING_AUTH_TOKEN}\" ${GN_EXTRA_ARGS_INTERNAL} ${GN_EXTRA_ARGS}" out/Debug
- runuser -p -u non_root -- time ninja -j${NUMJOBS} -C out/Debug chrome_public_apk
- runuser -p -u non_root -- time goma_ctl stat
rules:
- !reference [.rules_for_eyeo_chromium_jobs, rules, manual_job_for_mrs]
- !reference [.rules_for_eyeo_chromium_jobs, rules, only_on_success_for_full_pipeline]
- !reference [.rules_for_custom_pipelines, rules, default_run_manual]
- !reference [.rules_for_custom_pipelines, rules, run_android_arm_apk_debug_build]
artifacts:
expire_in: 1 day
paths:
- ./out/Debug/apks/ChromePublic.apk
build_arm_webview_release:
extends: .common_build_chromium
stage: build_arm_android_webview
needs: []
script:
- runuser -p -u non_root -- time gn gen --check --args='disable_fieldtrial_testing_config=true target_os="android" proprietary_codecs=true is_official_build=true use_goma=true enable_nacl=false is_debug=false ffmpeg_branding="Chrome" symbol_level=1 '"eyeo_telemetry_activeping_auth_token=\"${TELEMETRY_DEFAULT_SERVER_ACTIVEPING_AUTH_TOKEN}\" ${GN_EXTRA_ARGS_INTERNAL} ${GN_EXTRA_ARGS}" out/Release
- runuser -p -u non_root -- time ninja -j${NUMJOBS} -C out/Release system_webview_apk
- runuser -p -u non_root -- time goma_ctl stat
rules:
- !reference [.rules_for_eyeo_chromium_jobs, rules, only_on_success_for_full_pipeline]
- !reference [.rules_for_eyeo_chromium_jobs, rules, run_for_tags]
- !reference [.rules_for_eyeo_chromium_jobs, rules, manual_job_for_mrs]
- !reference [.rules_for_custom_pipelines, rules, run_android_arm_webview_release_build]
artifacts:
expire_in: 1 day
paths:
- "./out/Release/bin/system_webview_apk"
- "./out/Release/apks/SystemWebView.apk"
# Release builds use is_component_build=false by default
# Debug builds use is_component_build=true by default
# We build both for windows in nightly to ensure there are no linkage errors in either
build_windows_release:
extends: .windows_build_common
script:
- runuser -p -u non_root -- time gn gen --check --args='is_debug=false is_component_build=false disable_fieldtrial_testing_config=true proprietary_codecs=true ffmpeg_branding="Chrome" clang_use_default_sample_profile=false is_cfi=false use_goma=true enable_nacl=false symbol_level=0 blink_symbol_level=0 dcheck_always_on=false target_os="win" eyeo_intercept_debug_url=true '"eyeo_telemetry_activeping_auth_token=\"${TELEMETRY_DEFAULT_SERVER_ACTIVEPING_AUTH_TOKEN}\" ${GN_EXTRA_ARGS_INTERNAL} ${GN_EXTRA_ARGS}" out/Win
- BUILD_TARGETS="chrome mini_installer unit_tests components_unittests components_perftests browser_tests adblock_flatbuffer_converter "
- if [[ ! ${RUN_FOR_MODULE} == "true" ]]; then
BUILD_TARGETS+=" verify_flatbuffer_adblocking archive_eyeometry_test_server archive_eyeo_benchmarks ";
fi
- runuser -p -u non_root -- time ninja -j${NUMJOBS} -C out/Win ${BUILD_TARGETS}
- runuser -p -u non_root -- time goma_ctl stat
build_windows_debug:
extends: .windows_build_common
script:
- runuser -p -u non_root -- time gn gen --check --args='is_debug=true is_component_build=true disable_fieldtrial_testing_config=true proprietary_codecs=true ffmpeg_branding="Chrome" clang_use_default_sample_profile=false is_cfi=false use_goma=true enable_nacl=false symbol_level=0 blink_symbol_level=0 dcheck_always_on=false target_os="win" eyeo_intercept_debug_url=true '"eyeo_telemetry_activeping_auth_token=\"${TELEMETRY_DEFAULT_SERVER_ACTIVEPING_AUTH_TOKEN}\" ${GN_EXTRA_ARGS_INTERNAL} ${GN_EXTRA_ARGS}" out/Win
- BUILD_TARGETS="chrome unit_tests components_unittests components_perftests browser_tests adblock_flatbuffer_converter "
- if [[ ! ${RUN_FOR_MODULE} == "true" ]]; then
BUILD_TARGETS+=" verify_flatbuffer_adblocking archive_eyeometry_test_server archive_eyeo_benchmarks ";
fi
- runuser -p -u non_root -- time ninja -j${NUMJOBS} -C out/Win ${BUILD_TARGETS}
- runuser -p -u non_root -- time goma_ctl stat
desktop_performance_telemetry_tests:
stage: performance_tests
needs: ["build_linux_installer_release"]
dependencies: ["build_linux_installer_release"]
tags:
- docker
image: "openjdk:11"
variables:
GIT_STRATEGY: "none"
TESTING_BRANCH: "feature/telemetry"
TESTING_PROJECT_ID: "19526376" # https://gitlab.com/eyeo/distpartners/perf_test_automation
RUN_ALL_PLT_TEST_CASES: "false"
CHROMIUM_BRANCH: ${CI_COMMIT_BRANCH}
before_script:
- apt-get update
- apt-get install -qy jq python3-pip
- pip3 install minio
script:
# Get eyeo Chromium SDK file name
- cd out/Release ; CHROMIUM_FILENAME=$(ls *deb) ; cd $CI_PROJECT_DIR
# Download script to get pre-signed URL for artifacts used in the test
- wget $CI_PROJECT_URL/raw/$CI_COMMIT_SHA/.ci-scripts/minio_get_presigned_url.py
# Get URL for the ARM APK
- "export BUILD_JOB_ID=$(wget --header \"PRIVATE-TOKEN: ${CHROMIUM_GITLAB_COM_TOKEN}\" -O - ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/pipelines/${CI_PIPELINE_ID}/jobs | jq -c '.[] | select(.name == (\"build_linux_installer_release\")) | .id' | sort | tail -1)"
- export MINIO_OBJECT="${CI_PROJECT_PATH}/${CI_PIPELINE_ID}/${BUILD_JOB_ID}/out/Release/${CHROMIUM_FILENAME}"
- "export DESKTOP_FILE_URL=$(python3 minio_get_presigned_url.py ${CI_PROJECT_NAME} ${MINIO_OBJECT})"
- echo "Pre-signed URL with 1 day expiration is ${DESKTOP_FILE}"
# Start the pipeline
- echo "Triggering pipeline for ref ${TESTING_BRANCH} and project ID ${TESTING_PROJECT_ID}"
- curl -s --request POST
--form token=${DOWNSTREAM_PERF_TESTING_TOKEN}
--form ref=${TESTING_BRANCH}
--form "variables[DESKTOP_FILE_URL]=${DESKTOP_FILE_URL}"
--form "variables[PLATFORM]=\"desktop\""
--form "variables[RUN_ALL_PLT_TEST_CASES]=${RUN_ALL_PLT_TEST_CASES}"
--form "variables[BRANCH_FOR_REPORT]=${CHROMIUM_BRANCH}"
"https://gitlab.com/api/v4/projects/${TESTING_PROJECT_ID}/trigger/pipeline" > response.json
- *fail_if_pipeline_not_triggered
# Display pipeline URL
- echo "$(echo "See pipeline at ")" "$(cat response.json | jq -r ".web_url")"
# Due to a bug in gitlab, it's necessary to explicitly set allow_failure as true to avoid having the pipeline set as blocked
rules:
- !reference [.rules_for_eyeo_chromium_jobs, rules, on_success_for_full_scheduled_pipeline]
- !reference [.rules_for_eyeo_chromium_jobs, rules, run_for_tags]
- !reference [.rules_for_eyeo_chromium_jobs, rules, manual_job_for_mrs]
- !reference [.rules_for_custom_pipelines, rules, run_desktop_perf_tests]
performance_telemetry_tests:
stage: performance_tests
needs: ["build_arm_apk_release"]
dependencies: ["build_arm_apk_release"]
tags:
- docker
image: "openjdk:11"
variables:
GIT_STRATEGY: "none"
TESTING_BRANCH: "feature/telemetry"
TESTING_PROJECT_ID: "19526376" # https://gitlab.com/eyeo/distpartners/perf_test_automation
RUN_ALL_PLT_TEST_CASES: "false"
CHROMIUM_BRANCH: ${CI_COMMIT_BRANCH}
before_script:
- apt-get update
- apt-get install -qy jq python3-pip
- pip3 install minio
script:
# Download script to get pre-signed URL for artifacts used in the test
- wget $CI_PROJECT_URL/raw/$CI_COMMIT_SHA/.ci-scripts/minio_get_presigned_url.py
# Get URL for the ARM APK
- "export BUILD_JOB_ID=$(wget --header \"PRIVATE-TOKEN: ${CHROMIUM_GITLAB_COM_TOKEN}\" -O - ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/pipelines/${CI_PIPELINE_ID}/jobs | jq -c '.[] | select(.name == (\"build_arm_apk_release\")) | .id' | sort | tail -1)"
- export MINIO_OBJECT="${CI_PROJECT_PATH}/${CI_PIPELINE_ID}/${BUILD_JOB_ID}/out/Release/apks/ChromePublic.apk"
- "export APK_ARM=$(python3 minio_get_presigned_url.py ${CI_PROJECT_NAME} ${MINIO_OBJECT})"
- echo "Pre-signed URL with 1 day expiration is ${APK_ARM}"
# Start the pipeline
- echo "Triggering pipeline for ref ${TESTING_BRANCH} and project ID ${TESTING_PROJECT_ID}"
- curl -s --request POST
--form token=${DOWNSTREAM_PERF_TESTING_TOKEN}
--form ref=${TESTING_BRANCH}
--form "variables[APK_URL]=${APK_ARM}"
--form "variables[RUN_ALL_PLT_TEST_CASES]=${RUN_ALL_PLT_TEST_CASES}"
--form "variables[BRANCH_FOR_REPORT]=${CHROMIUM_BRANCH}"
"https://gitlab.com/api/v4/projects/${TESTING_PROJECT_ID}/trigger/pipeline" > response.json
- *fail_if_pipeline_not_triggered
# Display pipeline URL
- echo "$(echo "See pipeline at ")" "$(cat response.json | jq -r ".web_url")"
# Due to a bug in gitlab, it's necessary to explicitly set allow_failure as true to avoid having the pipeline set as blocked
rules:
# Always run full test suite on beta tags or for custom pipelines
- if: '$CI_COMMIT_TAG =~ /^eyeo-beta/'
variables:
RUN_ALL_PLT_TEST_CASES: "true"
- !reference [.rules_for_eyeo_chromium_jobs, rules, on_success_for_full_scheduled_pipeline]
- !reference [.rules_for_eyeo_chromium_jobs, rules, run_for_tags]
- !reference [.rules_for_eyeo_chromium_jobs, rules, manual_job_for_mrs]
- !reference [.rules_for_custom_pipelines, rules, run_mobile_perf_tests]
### Chromium Vanilla Jobs ###
# For each test suite, obtain the list of failing tests. These will be excluded when running against eyeo Chromium SDK,
# because we aren't the reason they fail.
# In order for the whole job to run to completion even with failing tests, the exit code for each test command must be ignored.
vanilla_build_and_test_desktop_release:
extends: .common_build_chromium
stage: build_linux
before_script:
- *configure_linux_gclient
# Disable local idle compiling to avoid issues when building
- export GOMA_USE_LOCAL="false"
- *common_build_chromium_before
script:
- runuser -p -u non_root -- time gn gen --check --args='disable_fieldtrial_testing_config=true is_debug=false use_goma=true enable_nacl=false proprietary_codecs=true ffmpeg_branding="Chrome" '"eyeo_telemetry_activeping_auth_token=\"${TELEMETRY_DEFAULT_SERVER_ACTIVEPING_AUTH_TOKEN}\" ${GN_EXTRA_ARGS_INTERNAL} ${GN_EXTRA_ARGS}" out/Release
- runuser -p -u non_root -- time ninja -j${NUMJOBS} -C out/Release unit_tests components_unittests components_perftests browser_tests chrome_sandbox
- export BUILDTYPE=Release
- export CHROME_DEVEL_SANDBOX=/usr/local/sbin/chrome-devel-sandbox
- runuser -p -u non_root -- time build/update-linux-sandbox.sh
- runuser -p -u non_root -- time goma_ctl stat
# Run tests suites 2 times to detect flaky tests.
- |+
for i in $(seq 1 2)
do
runuser -p -u non_root -- time xvfb-run ./out/Release/bin/run_unit_tests --test-launcher-retry-limit=0 --gtest_output="xml:out/Release/unit_tests_report.xml" >> out/Release/unit_tests.log || true
# Check if there are any failed, crashed and non-run tests
python3 ${GIT_CLONE_PATH}/.ci-scripts/get_failing_tests.py out/Release/unit_tests_report.xml >> out/Release/unit_tests_failed.txt;
/artifact-archiver/bootstrap.sh || true
done
num_unit_tests_failed=`wc -l out/Release/unit_tests_failed.txt`;
- |+
for i in $(seq 1 2)
do
runuser -p -u non_root -- time xvfb-run ./out/Release/bin/run_components_unittests --test-launcher-retry-limit=0 --gtest_output="xml:out/Release/components_unittests_report.xml" >> out/Release/components_unittests.log || true
# Check if there are any failed, crashed and non-run tests
python3 ${GIT_CLONE_PATH}/.ci-scripts/get_failing_tests.py out/Release/components_unittests_report.xml >> out/Release/components_unittests_failed.txt;
/artifact-archiver/bootstrap.sh || true
done
num_components_unittests_failed=`wc -l out/Release/components_unittests_failed.txt`;
# Run browser tests to generate report to get failing testcases from
- runuser -p -u non_root -- time xvfb-run -s "-screen 0 1024x768x24" out/Release/bin/run_browser_tests --test-launcher-retry-limit=0 --gtest_output="xml:out/Release/browser_tests_report.xml" --test-launcher-jobs=24 --no-sandbox | grep -v -e "error [0-9]\+.*Bad" >> out/Release/browser_tests.log || true
- python3 ${GIT_CLONE_PATH}/.ci-scripts/get_failing_tests.py out/Release/browser_tests_report.xml >> out/Release/browser_tests_failed.txt;
- num_browser_tests_failed=`wc -l out/Release/browser_tests_failed.txt`;
- /artifact-archiver/bootstrap.sh || true
# If any of the tests failed, exit with a custom code so a warning is shown
- if [[ -v ${num_unit_tests_failed} || -v ${num_components_unittests_failed} || -v ${num_browser_tests_failed} ]]; then exit 200; fi
rules:
- !reference [.rules_for_vanilla, rules, generic]
allow_failure:
exit_codes: 200
artifacts:
expire_in: 3 months
paths:
- "out/Release/unit_tests_failed.txt"
- "out/Release/unit_tests.log"
- "out/Release/components_unittests_failed.txt"
- "out/Release/components_unittests.log"
- "out/Release/browser_tests_failed.txt"
- "out/Release/browser_tests.log"
reports:
junit:
- "out/Release/unit_tests_report.xml"
- "out/Release/components_unittests_report.xml"
- "out/Release/browser_tests_report.xml"
when: always
vanilla_build_linux_installer_release:
extends: .common_build_chromium
stage: build_linux
before_script:
- *configure_linux_gclient
# Disable local idle compiling to avoid issues when building
- export GOMA_USE_LOCAL="false"
- *common_build_chromium_before
script:
# is_official_build=false is due to DPD-2064, it's a workaround. is_official_build should be true for performance tests.
- runuser -p -u non_root -- time gn gen --check --args='disable_fieldtrial_testing_config=true proprietary_codecs=true ffmpeg_branding="Chrome" use_goma=true enable_nacl=false is_component_build=false is_debug=false is_official_build=false chrome_pgo_phase = 0 '"eyeo_telemetry_activeping_auth_token=\"${TELEMETRY_DEFAULT_SERVER_ACTIVEPING_AUTH_TOKEN}\" ${GN_EXTRA_ARGS_INTERNAL} ${GN_EXTRA_ARGS}" out/Release
- runuser -p -u non_root -- time ninja -j${NUMJOBS} -C out/Release chrome/installer/linux:unstable_deb
- runuser -p -u non_root -- time goma_ctl stat
rules:
- !reference [.rules_for_vanilla, rules, generic]
artifacts:
expire_in: 3 months
paths:
- "out/Release/*.deb"
when: always
vanilla_performance_tests:
stage: performance_tests
# APK is needed in order to retrieve chromium version number, and pick correct vanilla branch
dependencies: ["build_arm_apk_release"]
needs: ["build_arm_apk_release"]
tags:
- docker
image: "openjdk:11"
variables:
GIT_STRATEGY: "none"
TESTING_BRANCH: "feature/telemetry"
TESTING_PROJECT_ID: "19526376" # https://gitlab.com/eyeo/distpartners/perf_test_automation
# For vanilla, always trigger all plt page sets tests
RUN_ALL_PLT_TEST_CASES: "true"
# For vanilla, always run with disable_adblock configuration
ADBLOCKING_CONFIG: "disable_adblock"
MEMORY_TEST_CASES: "eyeo.memory_full_filter_list_pageset_small_disable_adblock"
before_script:
# aapt is needed to get version Name from apk
- apt-get update
- apt-get install -qy aapt jq
script:
# Get correct vanilla version branch
- export VERSION_NUMBER=$(aapt dump badging ./out/Release/apks/ChromePublic.apk | grep "versionName" | sed -e "s/.*versionName='//" -e "s/' .*//")
- export VANILLA_BRANCH="chromium-${VERSION_NUMBER}-vanilla-automated"
- echo "Vanilla branch name is ${VANILLA_BRANCH}"
# Start the pipeline
- echo "Triggering pipeline for ref ${TESTING_BRANCH} and project ID ${TESTING_PROJECT_ID}"
- curl -s --request POST
--form token=${DOWNSTREAM_PERF_TESTING_TOKEN}
--form ref=${TESTING_BRANCH}
--form "variables[BRANCH_OR_TAG]=${VANILLA_BRANCH}"
--form "variables[ADBLOCKING_CONFIG]=${ADBLOCKING_CONFIG}"
--form "variables[MEMORY_TEST_CASES]=${MEMORY_TEST_CASES}"
--form "variables[RUN_ALL_PLT_TEST_CASES]=${RUN_ALL_PLT_TEST_CASES}"
"https://gitlab.com/api/v4/projects/${TESTING_PROJECT_ID}/trigger/pipeline" > response.json
- *fail_if_pipeline_not_triggered
# Display pipeline URL
- echo "$(echo "See pipeline at ")" "$(cat response.json | jq -r ".web_url")"
rules:
- !reference [.rules_for_vanilla, rules, performance_tests]
### eyeo Chromium SDK module distribution jobs ###
generate_modules:
stage: module_generation
image: "registry.gitlab.com/eyeo/docker/chromium-sdk_gitlab-runner:202212.1"
tags:
- vanilla-builder
needs: []
script:
- *set_git_to_use_ssh
- git remote set-url origin git@$CI_SERVER_HOST:$CI_PROJECT_PATH.git
- git config --global --add safe.directory /opt/ci/chromium-sdk/src
- git config user.name "${CI_PROJECT_NAME}"
- git config user.email "project_26591639_bot@noreply.gitlab.com"
# the cherry-pick later is huge so this needs setting to a bigger than default value
- git config merge.renameLimit 999999
# Change variable name for better readability
- EYEO_RELEASE_TAG=${CI_COMMIT_TAG}
# Modules generation needs a git log since the latest upstream commit, 10 should be fine.
- git fetch --deepen=10
# Run modules generation
- $CI_PROJECT_DIR/tools/eyeo/generate_modules.sh ${EYEO_RELEASE_TAG}
# Find latest release version to generate interdiffs
- PREVIOUS_CHROMIUM_VERSION=$(( $(echo ${EYEO_RELEASE_TAG} | cut -d "-" -f3 | cut -d "." -f1) -1 ))
- |
if [ $((PREVIOUS_CHROMIUM_VERSION%2)) -eq 0 ];