blob: 112887bb7149d37079afbddde323f62b2e1a224a [file]
# Copyright 2017 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
load(":test.bzl", "example_integration_test")
example_integration_test(
name = "examples_angular",
timeout = "long",
npm_packages = {
"//packages/karma:npm_package": "@bazel/karma",
"//packages/protractor:npm_package": "@bazel/protractor",
"//packages/rollup:npm_package": "@bazel/rollup",
"//packages/terser:npm_package": "@bazel/terser",
"//packages/typescript:npm_package": "@bazel/typescript",
},
tags = [
# bazel-in-bazel examples_angular fails on ubuntu as the bazelci
# ubuntu docker image is missing shares libs required for the versions
# of chrome and firefox fetched by rules_webtesting. On circleci
# we have the same issue but we can work around it using apt-get.
# on bazelci apt-get fails with permission denied and there is no sudo
# command to switch to root.
# TODO(gregmagolan): figure out how to install the shared libs on bazelci
"no-bazelci-ubuntu",
# bazel-in-bazel examples_angular fails on Windows on bazelci cloning a git repo:
# ```
# ERROR: no such package '@io_bazel_rules_k8s//k8s': Traceback (most recent call last):
# File "D:/b/ftxm343s/execroot/build_bazel_rules_nodejs/_tmp/3726d3573001cb4068a18af89eb255de/_bazel_b/ktluxf26/external/bazel_tools/tools/build_defs/repo/git.bzl", line 163
# _clone_or_update(ctx)
# File "D:/b/ftxm343s/execroot/build_bazel_rules_nodejs/_tmp/3726d3573001cb4068a18af89eb255de/_bazel_b/ktluxf26/external/bazel_tools/tools/build_defs/repo/git.bzl", line 36, in _clone_or_update
# git_repo(ctx, directory)
# ```
# This is most likely due to a memory issue with this large bazel-in-bazel test.
# TODO(gregmagolan): figure out what is broken with the above
"no-bazelci-windows",
],
)
example_integration_test(
name = "examples_angular_view_engine",
timeout = "long",
npm_packages = {
"//packages/karma:npm_package": "@bazel/karma",
"//packages/protractor:npm_package": "@bazel/protractor",
"//packages/rollup:npm_package": "@bazel/rollup",
"//packages/terser:npm_package": "@bazel/terser",
"//packages/typescript:npm_package": "@bazel/typescript",
},
tags = [
# bazel-in-bazel examples_angular_view_engine fails on ubuntu as the bazelci
# ubuntu docker image is missing shares libs required for the versions
# of chrome and firefox fetched by rules_webtesting. On circleci
# we have the same issue but we can work around it using apt-get.
# on bazelci apt-get fails with permission denied and there is no sudo
# command to switch to root.
# TODO(gregmagolan): figure out how to install the shared libs on bazelci
"no-bazelci-ubuntu",
# bazel-in-bazel examples_angular_view_engine fails on Windows on bazelci cloning a git repo:
# ```
# ERROR: no such package '@io_bazel_rules_k8s//k8s': Traceback (most recent call last):
# File "D:/b/ftxm343s/execroot/build_bazel_rules_nodejs/_tmp/3726d3573001cb4068a18af89eb255de/_bazel_b/ktluxf26/external/bazel_tools/tools/build_defs/repo/git.bzl", line 163
# _clone_or_update(ctx)
# File "D:/b/ftxm343s/execroot/build_bazel_rules_nodejs/_tmp/3726d3573001cb4068a18af89eb255de/_bazel_b/ktluxf26/external/bazel_tools/tools/build_defs/repo/git.bzl", line 36, in _clone_or_update
# git_repo(ctx, directory)
# ```
# This is most likely due to a memory issue with this large bazel-in-bazel test.
# TODO(gregmagolan): figure out what is broken with the above
"no-bazelci-windows",
],
)
example_integration_test(
name = "examples_react_webpack",
# TODO: add some tests in the example
bazel_commands = ["build ..."],
)
example_integration_test(
name = "examples_app",
npm_packages = {
"//packages/hide-bazel-files:npm_package": "@bazel/hide-bazel-files",
"//packages/protractor:npm_package": "@bazel/protractor",
"//packages/rollup:npm_package": "@bazel/rollup",
"//packages/terser:npm_package": "@bazel/terser",
"//packages/typescript:npm_package": "@bazel/typescript",
},
)
example_integration_test(
name = "examples_closure",
)
example_integration_test(
name = "examples_parcel",
npm_packages = {
"//packages/jasmine:npm_package": "@bazel/jasmine",
},
)
example_integration_test(
name = "examples_jest",
)
example_integration_test(
name = "examples_kotlin",
npm_packages = {
"//packages/jasmine:npm_package": "@bazel/jasmine",
"//packages/rollup:npm_package": "@bazel/rollup",
"//packages/terser:npm_package": "@bazel/terser",
},
# Kotlin's kt_js_import relies on a helper written in Python
# https://github.com/bazelbuild/rules_kotlin/blob/master/kotlin/internal/js/importer.py
# but python isn't installed on BazelCI windows machines.
# Failure looks like
# [0 / 57] [Prepa] Expanding template external/io_bazel_rules_kotlin/kotlin/internal/js/importer.temp [for host]
# ERROR: D:/temp/tmp-67520fayqgbwmbgd/BUILD.bazel:10:1: Action kotlinx-html-js.js failed (Exit 2)
# LAUNCHER ERROR: Cannot launch process: "python.exe"
tags = ["no-bazelci-windows"],
)
example_integration_test(
name = "examples_web_testing",
npm_packages = {
"//packages/karma:npm_package": "@bazel/karma",
"//packages/typescript:npm_package": "@bazel/typescript",
},
)
example_integration_test(
name = "examples_webapp",
npm_packages = {
"//packages/protractor:npm_package": "@bazel/protractor",
"//packages/rollup:npm_package": "@bazel/rollup",
"//packages/terser:npm_package": "@bazel/terser",
"//packages/typescript:npm_package": "@bazel/typescript",
},
)
example_integration_test(
name = "examples_nestjs",
bazel_commands = [
"build ...",
# Test cross-platform build
"build --platforms=@build_bazel_rules_nodejs//toolchains/node:linux_amd64 //src:docker",
],
npm_packages = {
"//packages/typescript:npm_package": "@bazel/typescript",
},
owners = [
"@zachgrayio",
"@zMotivat0r",
"@rayman1104",
"@siberex",
],
# Breaks on Windows with `rules_docker requires a python interpreter installed. Please set
# BAZEL_PYTHON, or put it on your path.`
tags = ["fix-windows"],
)
example_integration_test(
name = "examples_protocol_buffers",
timeout = "long",
npm_packages = {
"//packages/hide-bazel-files:npm_package": "@bazel/hide-bazel-files",
"//packages/karma:npm_package": "@bazel/karma",
"//packages/labs:npm_package": "@bazel/labs",
"//packages/protractor:npm_package": "@bazel/protractor",
"//packages/rollup:npm_package": "@bazel/rollup",
"//packages/terser:npm_package": "@bazel/terser",
"//packages/typescript:npm_package": "@bazel/typescript",
},
# Runs out of memory on bazelci windows
# TODO(gregmagolan): fix on bazelci windows
tags = ["no-bazelci-windows"],
)
example_integration_test(
name = "examples_user_managed_deps",
# This test requires calling `bazel run @nodejs//:yarn` before `bazel test ...`
bazel_commands = [
"run @nodejs//:yarn",
"test ...",
],
# replace the following repositories with the generated archives
repositories = {
"//:release": "build_bazel_rules_nodejs",
"@npm_bazel_jasmine//:release": "npm_bazel_jasmine",
},
)
example_integration_test(
name = "examples_vendored_node",
npm_packages = {
"//packages/jasmine:npm_package": "@bazel/jasmine",
},
# This example only works on linux as it downloads the linux node distribution
# TODO(gregmagolan): make node_repositories acccept different archives for different platforms
tags = ["manual"],
)
example_integration_test(
name = "examples_vendored_node_and_yarn",
npm_packages = {
"//packages/jasmine:npm_package": "@bazel/jasmine",
},
# This example only works on linux as it downloads the linux node distribution
# TODO(gregmagolan): make node_repositories acccept different archives for different platforms
tags = ["manual"],
)
example_integration_test(
name = "examples_worker",
# There are no tests in this example
bazel_commands = [
# By default this will build with worker enabled
"build //:do_work",
# Build again without the worker
"build --define=cache_bust=true --strategy=DoWork=standalone //:do_work",
],
npm_packages = {"//packages/worker:npm_package": "@bazel/worker"},
)