Skip to content

build: run saucelabs tests with bazel #19409

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 29 additions & 43 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -311,18 +311,42 @@ jobs:
<<: *job_defaults
resource_class: xlarge
environment:
GCP_DECRYPT_TOKEN: *gcp_decrypt_token
SAUCE_USERNAME: "angular-components"
SAUCE_ACCESS_KEY: "63348201a846-eeb9-3ee4-300f-ea990b8a"
# Note: This number should not be too high because otherwise we might run into
# a rate limit exception.
KARMA_PARALLEL_BROWSERS: 2
SAUCE_ACCESS_KEY: "a8b099ae-f003-4ee3-9bee-648a10284336"
SAUCE_TUNNEL_IDENTIFIER: angular-material-<< pipeline.id >>
steps:
- checkout_and_rebase
- *restore_cache
- *setup_bazel_ci_config
- *setup_bazel_remote_execution
- *yarn_install

- run: ./scripts/circleci/run-saucelabs-tests.sh
- run:
name: Saucelabs tunnel
command: ./scripts/saucelabs/start-tunnel.sh
background: true
- run:
name: Waiting for Saucelabs tunnel
command: ./scripts/saucelabs/wait-tunnel.sh
- run:
name: Saucelabs browser daemon
command: yarn -s sauce-bazel-daemon
background: true

- run:
name: Running tests
command: |
TESTS=$(yarn -s bazel query --output label '
attr("tags", "saucelabs", //src/...)
except attr("tags", "skip-on-remote-browsers", //src/...)
')
yarn -s bazel build ${TESTS}
yarn -s bazel test ${TESTS} --jobs=2

- run:
name: Shutting down tunnel
command: ./scripts/saucelabs/stop-tunnel.sh
- *slack_notify_on_failure

# ----------------------------------
Expand Down Expand Up @@ -663,46 +687,8 @@ workflows:

default_workflow:
jobs:
- bazel_build:
filters: *ignore_presubmit_branch_filter
- view_engine_build:
filters: *ignore_presubmit_branch_filter
- view_engine_test:
filters: *ignore_presubmit_branch_filter
- api_golden_checks:
filters: *ignore_presubmit_branch_filter
- integration_tests:
filters: *ignore_presubmit_branch_filter
- tests_local_browsers:
filters: *ignore_presubmit_branch_filter
- tests_browserstack:
filters: *ignore_presubmit_branch_filter
- tests_saucelabs:
filters: *ignore_presubmit_branch_filter
- e2e_tests:
filters: *ignore_presubmit_branch_filter
- build_release_packages:
filters: *ignore_presubmit_branch_filter
- upload_release_packages:
# We don't want to run this job on push builds because for those, the
# `publish_snapshots` runs, and publishes build artifacts.
filters: *only_on_pull_requests_filter
requires:
- build_release_packages
- lint:
filters: *ignore_presubmit_branch_filter
- ngcc_compatibility:
filters: *ignore_presubmit_branch_filter
requires:
- build_release_packages
- ngcc_compatibility_snapshot:
filters: *only_main_branch_filter
requires:
- build_release_packages
- publish_snapshots:
filters: *publish_branches_filter
requires:
- build_release_packages

# Snapshot tests workflow that is scheduled to run all specified jobs every hour.
# This workflow runs various jobs against the Angular snapshot builds from Github.
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
"integration-tests:size-test": "bazel test //integration/size-test/...",
"check-mdc-tests": "ts-node --project scripts/tsconfig.json scripts/check-mdc-tests.ts",
"check-mdc-exports": "ts-node --project scripts/tsconfig.json scripts/check-mdc-exports.ts",
"check-tools": "yarn tsc --project tools/tsconfig-ci.json"
"check-tools": "yarn tsc --project tools/tsconfig-ci.json",
"sauce-bazel-daemon": "ts-node --project tools/saucelabs-bazel/tsconfig.json tools/saucelabs-bazel/background-service/cli.ts"
},
"version": "12.1.0-next.0",
"dependencies": {
Expand All @@ -63,6 +64,7 @@
"@types/youtube": "^0.0.42",
"@webcomponents/custom-elements": "^1.1.0",
"core-js-bundle": "^3.8.2",
"karma-spec-reporter": "^0.0.32",
"material-components-web": "12.0.0-canary.b52196498.0",
"rxjs": "^6.5.3",
"rxjs-tslint-rules": "^4.33.1",
Expand Down
29 changes: 0 additions & 29 deletions scripts/circleci/run-saucelabs-tests.sh

This file was deleted.

4 changes: 2 additions & 2 deletions scripts/saucelabs/start-tunnel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ rm ${tunnelFileName}
# Command arguments that will be passed to sauce-connect.
sauceArgs="--readyfile ${tunnelReadyFile} --pidfile ${tunnelPidFile}"

if [ ! -z "${CIRCLE_BUILD_NUM}" ]; then
sauceArgs="${sauceArgs} --tunnel-identifier angular-material-${CIRCLE_BUILD_NUM}-${CIRCLE_NODE_INDEX}"
if [ ! -z "${SAUCE_TUNNEL_IDENTIFIER}" ]; then
sauceArgs="${sauceArgs} --tunnel-identifier ${SAUCE_TUNNEL_IDENTIFIER}"
fi

echo "Starting Sauce Connect in the background. Passed arguments: ${sauceArgs}"
Expand Down
4 changes: 2 additions & 2 deletions src/cdk-experimental/combobox/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ng_module(
)

ng_test_library(
name = "unit_test_sources",
name = "unit_tests_lib",
srcs = glob(
["**/*.spec.ts"],
exclude = ["**/*.e2e.spec.ts"],
Expand All @@ -34,5 +34,5 @@ ng_test_library(

ng_web_test_suite(
name = "unit_tests",
deps = [":unit_test_sources"],
deps = [":unit_tests_lib"],
)
4 changes: 2 additions & 2 deletions src/cdk-experimental/dialog/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ sass_binary(
)

ng_test_library(
name = "unit_test_sources",
name = "unit_tests_lib",
srcs = glob(
["**/*.spec.ts"],
exclude = ["**/*.e2e.spec.ts"],
Expand All @@ -47,5 +47,5 @@ ng_test_library(

ng_web_test_suite(
name = "unit_tests",
deps = [":unit_test_sources"],
deps = [":unit_tests_lib"],
)
4 changes: 2 additions & 2 deletions src/cdk-experimental/listbox/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ng_module(
)

ng_test_library(
name = "unit_test_sources",
name = "unit_tests_lib",
srcs = glob(
["**/*.spec.ts"],
exclude = ["**/*.e2e.spec.ts"],
Expand All @@ -36,5 +36,5 @@ ng_test_library(

ng_web_test_suite(
name = "unit_tests",
deps = [":unit_test_sources"],
deps = [":unit_tests_lib"],
)
4 changes: 2 additions & 2 deletions src/cdk-experimental/menu/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ng_module(
)

ng_test_library(
name = "unit_test_sources",
name = "unit_tests_lib",
srcs = glob(
["**/*.spec.ts"],
exclude = ["**/*.e2e.spec.ts"],
Expand All @@ -40,5 +40,5 @@ ng_test_library(

ng_web_test_suite(
name = "unit_tests",
deps = [":unit_test_sources"],
deps = [":unit_tests_lib"],
)
4 changes: 2 additions & 2 deletions src/cdk-experimental/popover-edit/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ng_module(
)

ng_test_library(
name = "unit_test_sources",
name = "unit_tests_lib",
srcs = glob(
["**/*.spec.ts"],
exclude = ["**/*.e2e.spec.ts"],
Expand All @@ -45,5 +45,5 @@ ng_test_library(

ng_web_test_suite(
name = "unit_tests",
deps = [":unit_test_sources"],
deps = [":unit_tests_lib"],
)
8 changes: 4 additions & 4 deletions src/cdk-experimental/scrolling/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ng_module(
)

ng_test_library(
name = "unit_test_sources",
name = "unit_tests_lib",
srcs = glob(
["**/*.spec.ts"],
exclude = ["**/*.e2e.spec.ts"],
Expand All @@ -34,11 +34,11 @@ ng_test_library(

ng_web_test_suite(
name = "unit_tests",
deps = [":unit_test_sources"],
deps = [":unit_tests_lib"],
)

ng_e2e_test_library(
name = "e2e_test_sources",
name = "e2e_tests_lib",
srcs = glob(["**/*.e2e.spec.ts"]),
deps = [
"//src/cdk/testing/private/e2e",
Expand All @@ -48,7 +48,7 @@ ng_e2e_test_library(
e2e_test_suite(
name = "e2e_tests",
deps = [
":e2e_test_sources",
":e2e_tests_lib",
"//src/cdk/testing/private/e2e",
],
)
4 changes: 2 additions & 2 deletions src/cdk-experimental/selection/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ng_module(
)

ng_test_library(
name = "unit_test_sources",
name = "unit_tests_lib",
srcs = glob(
["**/*.spec.ts"],
exclude = ["**/*.e2e.spec.ts"],
Expand All @@ -35,5 +35,5 @@ ng_test_library(

ng_web_test_suite(
name = "unit_tests",
deps = [":unit_test_sources"],
deps = [":unit_tests_lib"],
)
4 changes: 2 additions & 2 deletions src/cdk-experimental/table-scroll-container/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ng_module(
)

ng_test_library(
name = "unit_test_sources",
name = "unit_tests_lib",
srcs = glob(
["**/*.spec.ts"],
exclude = ["**/*.e2e.spec.ts"],
Expand All @@ -41,5 +41,5 @@ ng_test_library(

ng_web_test_suite(
name = "unit_tests",
deps = [":unit_test_sources"],
deps = [":unit_tests_lib"],
)
4 changes: 2 additions & 2 deletions src/cdk/a11y/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ sass_binary(
)

ng_test_library(
name = "unit_test_sources",
name = "unit_tests_lib",
srcs = glob(
["**/*.spec.ts"],
exclude = ["**/*.e2e.spec.ts"],
Expand All @@ -60,7 +60,7 @@ ng_test_library(

ng_web_test_suite(
name = "unit_tests",
deps = [":unit_test_sources"],
deps = [":unit_tests_lib"],
)

markdown_to_html(
Expand Down
4 changes: 2 additions & 2 deletions src/cdk/accordion/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ng_module(
)

ng_test_library(
name = "unit_test_sources",
name = "unit_tests_lib",
srcs = glob(
["**/*.spec.ts"],
exclude = ["**/*.e2e.spec.ts"],
Expand All @@ -37,7 +37,7 @@ ng_test_library(

ng_web_test_suite(
name = "unit_tests",
deps = [":unit_test_sources"],
deps = [":unit_tests_lib"],
)

markdown_to_html(
Expand Down
4 changes: 2 additions & 2 deletions src/cdk/bidi/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ng_module(
)

ng_test_library(
name = "unit_test_sources",
name = "unit_tests_lib",
srcs = glob(
["**/*.spec.ts"],
exclude = ["**/*.e2e.spec.ts"],
Expand All @@ -35,7 +35,7 @@ ng_test_library(

ng_web_test_suite(
name = "unit_tests",
deps = [":unit_test_sources"],
deps = [":unit_tests_lib"],
)

markdown_to_html(
Expand Down
4 changes: 2 additions & 2 deletions src/cdk/clipboard/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ng_module(
)

ng_test_library(
name = "unit_test_sources",
name = "unit_tests_lib",
srcs = glob(
["**/*.spec.ts"],
exclude = ["**/*.e2e.spec.ts"],
Expand All @@ -32,7 +32,7 @@ ng_test_library(

ng_web_test_suite(
name = "unit_tests",
deps = [":unit_test_sources"],
deps = [":unit_tests_lib"],
)

markdown_to_html(
Expand Down
4 changes: 2 additions & 2 deletions src/cdk/coercion/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ts_library(
)

ts_library(
name = "unit_test_sources",
name = "unit_tests_lib",
testonly = True,
srcs = glob(
["**/*.spec.ts"],
Expand All @@ -30,7 +30,7 @@ ts_library(

karma_web_test_suite(
name = "unit_tests",
deps = [":unit_test_sources"],
deps = [":unit_tests_lib"],
)

markdown_to_html(
Expand Down
Loading