mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
build: run CI unit tests using bazel (#16379)
This commit is contained in:
committed by
Andrew Seguin
parent
bb66df77af
commit
2bf06125a2
+16
-13
@@ -128,9 +128,9 @@ version: 2
|
||||
jobs:
|
||||
|
||||
# -----------------------------------
|
||||
# Build and test job that uses Bazel.
|
||||
# Job to test that everything builds with Bazel
|
||||
# -----------------------------------
|
||||
bazel_build_test:
|
||||
bazel_build:
|
||||
<<: *job_defaults
|
||||
resource_class: xlarge
|
||||
environment:
|
||||
@@ -144,7 +144,6 @@ jobs:
|
||||
- *yarn_install
|
||||
|
||||
- run: yarn bazel build src/... --build_tag_filters=-docs-package
|
||||
- run: yarn bazel test src/... --build_tag_filters=-docs-package --test_tag_filters=-e2e
|
||||
|
||||
# --------------------------------------------------------------------------------------------
|
||||
# Job that runs ts-api-guardian against our API goldens in "tools/public_api_guard".
|
||||
@@ -185,18 +184,22 @@ jobs:
|
||||
|
||||
# ------------------------------------------------------------------------------------------
|
||||
# Job that runs the unit tests on locally installed browsers (Chrome and Firefox headless).
|
||||
# The available browsers are installed through the angular/ngcontainer Docker image.
|
||||
# The available browsers are chromium and firefox
|
||||
# ------------------------------------------------------------------------------------------
|
||||
tests_local_browsers:
|
||||
docker: *docker-firefox-image
|
||||
<<: *job_defaults
|
||||
resource_class: xlarge
|
||||
environment:
|
||||
GCP_DECRYPT_TOKEN: *gcp_decrypt_token
|
||||
steps:
|
||||
- *checkout_code
|
||||
- *restore_cache
|
||||
- *yarn_download
|
||||
- *yarn_install
|
||||
- *checkout_code
|
||||
- *restore_cache
|
||||
- *setup_bazel_ci_config
|
||||
- *setup_bazel_remote_execution
|
||||
- *yarn_download
|
||||
- *yarn_install
|
||||
|
||||
- run: ./scripts/circleci/run-local-browser-tests.sh
|
||||
- run: yarn bazel test src/... --build_tag_filters=-e2e --test_tag_filters=-e2e
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Job that runs the unit tests on Browserstack. The browsers that will be used
|
||||
@@ -447,17 +450,17 @@ workflows:
|
||||
|
||||
bazel_targets:
|
||||
jobs:
|
||||
- bazel_build_test:
|
||||
- bazel_build:
|
||||
filters: *ignore_presubmit_branch_filter
|
||||
- ivy_test:
|
||||
filters: *ignore_presubmit_branch_filter
|
||||
- api_golden_checks:
|
||||
filters: *ignore_presubmit_branch_filter
|
||||
- tests_local_browsers:
|
||||
filters: *ignore_presubmit_branch_filter
|
||||
|
||||
unit_tests:
|
||||
jobs:
|
||||
- tests_local_browsers:
|
||||
filters: *ignore_presubmit_branch_filter
|
||||
- tests_browserstack:
|
||||
filters: *ignore_presubmit_branch_filter
|
||||
- tests_saucelabs:
|
||||
|
||||
+2
-1
@@ -18,7 +18,8 @@
|
||||
"bazel:buildifier": "find . -type f \\( -name \"*.bzl\" -or -name WORKSPACE -or -name BUILD -or -name BUILD.bazel \\) ! -path \"*/node_modules/*\" | xargs buildifier -v --warnings=attr-cfg,attr-license,attr-non-empty,attr-output-default,attr-single-file,constant-glob,ctx-args,depset-iteration,depset-union,dict-concatenation,duplicated-name,filetype,git-repository,http-archive,integer-division,load,load-on-top,native-build,native-package,output-group,package-name,package-on-top,redefined-variable,repository-name,same-origin-load,string-iteration,unused-variable",
|
||||
"bazel:format-lint": "yarn -s bazel:buildifier --lint=warn --mode=check",
|
||||
"dev-app": "gulp serve:devapp",
|
||||
"test": "bazel test //src/... --test_tag_filters=-e2e",
|
||||
"test": "bazel test //src/... --test_tag_filters=-e2e,-browser:firefox-local --build_tag_filters=-browser:firefox-local --build_tests_only",
|
||||
"test-firefox": "bazel test //src/... --test_tag_filters=-e2e,-browser:chromium-local --build_tag_filters=-browser:chromium-local --build_tests_only",
|
||||
"lint": "gulp lint && yarn -s bazel:format-lint",
|
||||
"e2e": "bazel test //src/... --test_tag_filters=e2e",
|
||||
"deploy": "gulp deploy:devapp",
|
||||
|
||||
@@ -164,6 +164,10 @@ def ng_web_test_suite(deps = [], static_css = [], bootstrap = [], **kwargs):
|
||||
deps = [
|
||||
"//test:angular_test_init",
|
||||
] + deps,
|
||||
browsers = [
|
||||
"@io_bazel_rules_webtesting//browsers:chromium-local",
|
||||
"@io_bazel_rules_webtesting//browsers:firefox-local",
|
||||
],
|
||||
bootstrap = [
|
||||
"@npm//node_modules/zone.js:dist/zone-testing-bundle.js",
|
||||
"@npm//node_modules/reflect-metadata:Reflect.js",
|
||||
|
||||
Reference in New Issue
Block a user