启用Windows上的所有Angular Bazel测试

n3schb8v  于 5个月前  发布在  Angular
关注(0)|答案(4)|浏览(62)

🐞 bug报告

是否为回归?

描述

Angular测试在Windows上仅部分启用:
angular/.codefresh/codefresh.yml
第22行到第24行 in 1102b02
| | #运行测试 |
| | - 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 |
为了在Windows上有更好的支持,我们应该能够运行所有Windows上的测试,即:

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

(IIUC, yarn test-ivy-aot //... 基本上是 bazel test --define=compile=aot --build_tag_filters=-no-ivy-aot,-fixme-ivy-aot --test_tag_filters=-no-ivy-aot,-fixme-ivy-aot //... )
我尝试在不使用 ivy-only 的情况下运行所有测试,并在使用 Bazel 0.24.1时得到了以下结果。查看详细信息请点击 Angular test with Bazel 0.24.1
问题出在 powershell.exe 在使用 --incompatible_strict_action_env 时不可用。所以我向Bazel提交了一个更改来解决这个问题。 bazelbuild/bazel@6e75219
在Bazel@6e75219中,在解决一些兼容性问题后,我可以在Windows上构建和运行所有Angular测试。结果如下:

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.

当前待办事项列表如下:

  • 等待包含 bazelbuild/bazel@6e75219 的Bazel发布,应该是0.26(你更喜欢将其选为0.25的cherry-pick吗?这样我们本月就可以使用了?)
  1. 修复兼容性问题:
  2. build: Fix label name #29777
  3. bazel-0.24.1 build --nobuild //... --incompatible_bzl_disallow_load_after_statement
  4. 等待修复(Fix config_setting for msvc google/brotli#748)brotli,然后更新org_brotli
  5. 研究使用Bazel@6e75219失败的测试,将提供一种重现方法。

🔬最小复现

# 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

请注意,直到兼容性问题得到修复,我们仍然需要 --incompatible_bzl_disallow_load_after_statement=false
如果您无法构建brotli,您可以在 packages/bazel/package.bzl 中使用以下内容:

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

🌍您的环境

Angular版本:

ec5635430630fb895ddb43017f9939564824e8f8
djp7away

djp7away1#

需要修复的测试用例:

  • 编译选项:--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
j91ykkif

j91ykkif2#

注意,我们可以将Bazel的夜间快照发布到npm,因此我们不一定需要等待修复程序发布。我在https://github.com/alexeagle/rules_nodejs/tree/nightly_bazel开始这个项目,但需要一些帮助来完成。

lbsnaicq

lbsnaicq3#

为了澄清:有没有解决方法让测试在Windows上成功运行?
我在#30251#30252遇到了类似的问题😞

z0qdvdin

z0qdvdin4#

#30252 将由 bazelbuild/bazel@6e75219 修复,该版本将在 0.26.0 中发布。
我可以帮忙调查 #30251 ,这看起来像是一个错误而不是真正的性能问题。

相关问题