|
| 1 | +load("@bazel_skylib//lib:dicts.bzl", "dicts") |
| 2 | +load("//tools:integration.bzl", "CLI_PROJECT_MAPPINGS") |
| 3 | +load("//tools:defaults.bzl", "node_integration_test") |
| 4 | + |
| 5 | +npmPackageMappings = dicts.add( |
| 6 | + CLI_PROJECT_MAPPINGS, |
| 7 | + { |
| 8 | + "//src/cdk:npm_package_archive": "@angular/cdk", |
| 9 | + "//src/material:npm_package_archive": "@angular/material", |
| 10 | + }, |
| 11 | +) |
| 12 | + |
| 13 | +node_integration_test( |
| 14 | + name = "test", |
| 15 | + srcs = glob(["**/*"]), |
| 16 | + commands = [ |
| 17 | + # Note: We use a cache folder within the integration test as otherwise |
| 18 | + # the NPM package mapped archive would be cached in the system. |
| 19 | + # See: https://github.com/yarnpkg/yarn/issues/2165. |
| 20 | + # TODO(devversion): determine if a solution/workaround could live in the test runner. |
| 21 | + "yarn install --cache-folder .yarn_cache_folder/", |
| 22 | + "yarn ng add @angular/material", |
| 23 | + "yarn test", |
| 24 | + ], |
| 25 | + npm_packages = npmPackageMappings, |
| 26 | + tags = [ |
| 27 | + # Chromium cannot run in Sandbox. For this test, sandbox is disabled. |
| 28 | + # Additionally, we need to disable RBE as this test relies on internet |
| 29 | + # access for installing the NPM packages. |
| 30 | + "no-sandbox", |
| 31 | + "no-remote-exec", |
| 32 | + ], |
| 33 | +) |
| 34 | + |
| 35 | +node_integration_test( |
| 36 | + name = "test_node12", |
| 37 | + srcs = glob(["**/*"]), |
| 38 | + commands = [ |
| 39 | + # Note: We use a cache folder within the integration test as otherwise |
| 40 | + # the NPM package mapped archive would be cached in the system. |
| 41 | + # See: https://github.com/yarnpkg/yarn/issues/2165. |
| 42 | + # TODO(devversion): determine if a solution/workaround could live in the test runner. |
| 43 | + "yarn install --cache-folder .yarn_cache_folder/", |
| 44 | + "node --version", |
| 45 | + "yarn node --version", |
| 46 | + "yarn ng add @angular/material", |
| 47 | + "yarn test", |
| 48 | + ], |
| 49 | + npm_packages = npmPackageMappings, |
| 50 | + tags = [ |
| 51 | + # Chromium cannot run in Sandbox. For this test, sandbox is disabled. |
| 52 | + # Additionally, we need to disable RBE as this test relies on internet |
| 53 | + # access for installing the NPM packages. |
| 54 | + "no-sandbox", |
| 55 | + "no-remote-exec", |
| 56 | + ], |
| 57 | + tool_mappings = { |
| 58 | + "@node12_host//:yarn_bin": "yarn", |
| 59 | + "@node12_host//:node_bin": "node", |
| 60 | + }, |
| 61 | +) |
0 commit comments