Skip to content

Enable all Angular Bazel Tests on Windows #29785

Closed

Description

@meteorcloudy

🐞 bug report

Is this a regression?

Nope

Description

Angular tests are only partially enabled on Windows:

# Run tests
- yarn bazel test //tools/ts-api-guardian:all
- yarn test-ivy-aot //packages/animations/test //packages/common/test //packages/forms/test //packages/http/test //packages/platform-browser/test //packages/platform-browser-dynamic/test //packages/router/test

To have better Windows support, we should be able to run all tests on Windows, that is:

bazel test //... --build_tag_filters=-ivy-only --test_tag_filters=-ivy-only
yarn test-ivy-aot //...

(IIUC, yarn test-ivy-aot //... is essentially bazel test --define=compile=aot --build_tag_filters=-no-ivy-aot,-fixme-ivy-aot --test_tag_filters=-no-ivy-aot,-fixme-ivy-aot //...)

I tried to run all tests without ivy-only with Bazel 0.24.1 and got

Executed 102 out of 175 tests: 86 tests pass, 72 fail to build and 17 fail locally.

See full detail at Angular test with Bazel 0.24.1

It turned out all broken tests are because powershell.exe is not available when using --incompatible_strict_action_env. So I sent a change in Bazel to fix this problem. bazelbuild/bazel@6e75219

With Bazel@6e75219, after working around some incompatibility issues, I'm able to build and run all Angular tests on Windows. The results are:

Executed 175 out of 175 tests: 152 tests pass and 23 fail locally.
Executed 7 out of 147 tests: 140 tests pass and 7 fail locally.

Current TODO list is:

🔬 Minimal Reproduction

# Get Bazel binary built at 6e752195f0b0c6d67822368b82c990dff168a258
wget https://storage.googleapis.com/bazel-builds/artifacts/windows/6e752195f0b0c6d67822368b82c990dff168a258/bazel -O <your preferred Bazel path (with .exe extension)>

# Cherry-pick https://github.com/angular/angular/pull/29777 if it's still not merged.

# Run tests except ivy-only
bazel test //... --build_tag_filters=-ivy-only --test_tag_filters=-ivy-only --incompatible_bzl_disallow_load_after_statement=false

# Run ivy-only tests 
bazel test //... --define=compile=aot --build_tag_filters=-no-ivy-aot,-fixme-ivy-aot --test_tag_filters=-no-ivy-aot,-fixme-ivy-aot --incompatible_bzl_disallow_load_after_statement=false

Note that we still need --incompatible_bzl_disallow_load_after_statement=false until the incompatibility issue is fixed.

If you failed to build brotli, you can use the following in packages/bazel/package.bzl:

    http_archive(
        name = "org_brotli",
        sha256 = "44ebae3308fd1a757fdc4891e1e1e61ab964afb223ba298d2ea0c29a49564f53",
        strip_prefix = "brotli-7388ebb113f0e1dbf4ab0f2daddf036abf29b8e6",
        url = "https://github.com/meteorcloudy/brotli/archive/7388ebb113f0e1dbf4ab0f2daddf036abf29b8e6.zip",
    )

🌍 Your Environment

Angular Version:


ec5635430630fb895ddb43017f9939564824e8f8

@alexeagle @filipesilva Can you point this issue to correct people in Angular Windows team? I will also continue to help investigating.

Activity

  1. added
    area: bazelIssues related to the published `@angular/bazel` build rules
    on Apr 9, 2019
  2. added this to the needsTriage milestone on Apr 9, 2019
  3. meteorcloudy commented on Apr 10, 2019

    @meteorcloudy
    ContributorAuthor

    Tests to be fixed:

    --build_tag_filters=-ivy-only --test_tag_filters=-ivy-only:

    • //packages/compiler-cli/ngcc/test:integration TIMEOUT in 300.2s
    • //modules/benchmarks/src/largetable/ng2:perf_chromium-local FAILED in 170.2s
    • //modules/benchmarks/src/largetable/ng2_switch:perf_chromium-local FAILED in 183.2s
    • //modules/benchmarks/src/tree/iv:perf_chromium-local FAILED in 25.1s
    • //modules/benchmarks/src/tree/ng1:perf_chromium-local FAILED in 259.2s
    • //modules/playground/e2e_test/sourcemap:protractor_tests_chromium-local FAILED in 31.4s
    • //packages/bazel/test/ngc-wrapped:ngc_test FAILED in 7.8s
    • //packages/bazel/test/protractor-2:prodserver_test_chromium-local FAILED in 11.0s
    • //packages/compiler-cli/integrationtest:integrationtest FAILED in 25.9s
    • //packages/compiler-cli/ngcc/test:test FAILED in 6.2s
    • //packages/compiler-cli/test:ngc FAILED in 183.3s
    • //packages/compiler-cli/test/ngtsc:ngtsc FAILED in 157.0s
    • //packages/compiler/test:test FAILED in 31.2s
    • //packages/language-service/test:test FAILED in 278.0s
    • //tools/public_api_guard:common_api FAILED in 7.0s
    • //tools/public_api_guard:core_api FAILED in 6.2s
    • //tools/public_api_guard:core_testing_api FAILED in 6.7s
    • //tools/public_api_guard:forms_api FAILED in 6.1s
    • //tools/public_api_guard:http_api FAILED in 4.6s
    • //tools/public_api_guard:router_api FAILED in 4.7s
    • //tools/public_api_guard:service-worker_config_api FAILED in 7.5s
    • //tools/public_api_guard:upgrade_static_api FAILED in 4.6s
    • //tools/ts-api-guardian:tests FAILED in 12.9s

    --define=compile=aot --build_tag_filters=-no-ivy-aot,-fixme-ivy-aot --test_tag_filters=-no-ivy-aot,-fixme-ivy-aot

    • //modules/playground/e2e_test/sourcemap:protractor_tests_chromium-local FAILED in 13.5s
    • //packages/bazel/test/ngc-wrapped:ngc_test FAILED in 4.8s
    • //packages/bazel/test/protractor-2:prodserver_test_chromium-local FAILED in 9.6s
    • //packages/compiler-cli/ngcc/test:test FAILED in 9.0s
    • //packages/compiler-cli/test/compliance:compliance FAILED in 76.0s
    • //packages/compiler-cli/test/ngtsc:ngtsc FAILED in 96.6s
    • //tools/ts-api-guardian:tests FAILED in 11.4s
  4. alexeagle commented on Apr 10, 2019

    @alexeagle
    Contributor

    note, we can publish nightly snapshots of Bazel to npm, so we don't necessarily need to wait for fixes to be released. I started this in https://github.com/alexeagle/rules_nodejs/tree/nightly_bazel but need some help to finish probably

  5. modified the milestones: needsTriage, Backlog on Apr 24, 2019
  6. 12 remaining items

  7. added
    windowsIssue related to Microsoft's Windows operating system
    on May 18, 2020
  8. added
    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
    and removed on Oct 1, 2020
  9. angular-automatic-lock-bot commented on May 25, 2025

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  10. locked and limited conversation to collaborators on May 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: bazelIssues related to the published `@angular/bazel` build rulesarea: build & ciRelated the build and CI infrastructure of the projectfreq2: mediumtype: bug/fixwindowsIssue related to Microsoft's Windows operating system

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions