Raw File
load(":angular_integration_test.bzl", "angular_integration_test")

# Some integration ports must be managed manually to be unique and in other
# cases the tests are able to select a random free port.
#
# Where `ng e2e` is used we pass `ng e2e --port 0` which prompts the cli
# to select a random free port for the e2e test. The protractor.conf is
# automatically updated to use this port.
#
# Karma automatically finds a free port so no effort is needed there.
#
# The manually configured ports are as follows:
#
#   TEST                                PORT        CONFIGURATION
#   ====                                ====        =============
#   dynamic-compiler                    4201        /e2e/browser.config.json: "port": 4201
#   hello_world__closure                4202        /e2e/browser.config.json: "port": 4202
#   i18n                                4204        /e2e/browser.config.json: "port": 4204
#   ng_elements                         4205        /e2e/browser.config.json: "port": 4205
#   platform-server                     4206        /src/server.ts: app.listen(4206,...

# Map of integration tests to tags.
# A subset of these tests fail or are not meant to be run with ivy bundles. These are tagged
# "view-engine-only".
INTEGRATION_TESTS = {
    "bazel": {
        "tags": [
            # Bazel-in-bazel tests are resource intensive and should not be over-parallized
            # as they will compete for the resources of other parallel tests slowing
            # everything down. Ask Bazel to allocate multiple CPUs for these tests with "cpu:n" tag.
            "cpu:3",
        ],
    },
    "cli-elements-universal": {},
    "cli-hello-world": {
        "commands": "payload_size_tracking",
    },
    "cli-hello-world-ivy-compat": {
        "commands": "payload_size_tracking",
    },
    "cli-hello-world-ivy-i18n": {
        "commands": "payload_size_tracking",
    },
    "cli-hello-world-ivy-minimal": {
        "commands": "payload_size_tracking",
    },
    "cli-hello-world-lazy": {
        "commands": "payload_size_tracking",
    },
    "dynamic-compiler": {},
    "forms": {
        "commands": "payload_size_tracking",
    },
    "hello_world__closure": {
        # TODO: Re-enable the payload_size_tracking command:
        #   We should define ngDevMode to false in Closure, but --define only works in the global scope.
        #   With ngDevMode not being set to false, this size tracking test provides little value but a lot of
        #   headache to continue updating the size.
    },
    "i18n": {},
    "injectable-def": {
        # This test relies on ESM for running the app in SSR. RxJS added ESM resolution
        # support with RXJS v7. We allow the version to be pinned to v7.
        # TODO: Remove this and update the test once the project uses RxJS v7, or if rxjs v6 has ESM support.
        "pinned_npm_packages": ["rxjs"],
    },
    "ivy-i18n": {},
    "trusted-types": {},
    "ng-add-localize": {},
    "ng_elements": {},
    "ng_update": {},
    "ng_update_migrations": {},
    "ngcc": {
        "use_view_engine_packages": [
            "@angular/animations",
            "@angular/common",
            "@angular/core",
            "@angular/forms",
            "@angular/platform-browser",
            "@angular/platform-browser-dynamic",
            "@angular/platform-server",
            "@angular/router",
        ],
    },
    "platform-server": {},
    "service-worker-schema": {},
    # The `side-effects` test is currently disabled as it does not run the
    # Angular linker plugin and therefore partial declarations are retained
    # as side-effects. To make this test helpful again, we need to run the linker.
    # TODO(devversion): replace this with a solution we maintain that runs the Babel linker plugin.
    "side-effects": {"tags": ["manual"]},
    "terser": {},
    "typings_test_rxjs7": {
        # The project root uses an older version than the one we want to test here.
        "pinned_npm_packages": ["rxjs"],
    },
    "typings_test_ts44": {
        # Special case for `typings_test_ts44` test as we want to pin
        # `typescript` at version 4.4.x for that test and not link to the
        # root @npm//typescript package.
        "pinned_npm_packages": ["typescript"],
    },
}

[
    angular_integration_test(
        name = test_folder,
        commands = INTEGRATION_TESTS[test_folder].get("commands", "default"),
        pinned_npm_packages = INTEGRATION_TESTS[test_folder].get("pinned_npm_packages", []),
        tags = INTEGRATION_TESTS[test_folder].get("tags", []),
        use_view_engine_packages = INTEGRATION_TESTS[test_folder].get("use_view_engine_packages", []),
    )
    for test_folder in INTEGRATION_TESTS
]
back to top