From 684579b338fe59a794917aaeb3e180b85de5e963 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Wed, 24 Jul 2019 10:03:51 +0200 Subject: [PATCH] build: create google3 migration tests bazel target (#31817) Creates a separate bazel target for the google3 migration tests. The benefit is that it's faster to run tests for public migrations in development. Google3 lint rules are usually another story/implementation and the tests are quite slow due to how TSLint applies replacements. Additionally if something changes in the google3 tslint rules, the tests which aren't affected re-run unnecessarily. PR Close #31817 --- .../schematics/migrations/google3/BUILD.bazel | 2 +- .../renderer-to-renderer2/google3/BUILD.bazel | 2 +- packages/core/schematics/test/BUILD.bazel | 4 +--- .../core/schematics/test/google3/BUILD.bazel | 21 +++++++++++++++++++ 4 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 packages/core/schematics/test/google3/BUILD.bazel diff --git a/packages/core/schematics/migrations/google3/BUILD.bazel b/packages/core/schematics/migrations/google3/BUILD.bazel index 63c73a028c..ca1a699ddd 100644 --- a/packages/core/schematics/migrations/google3/BUILD.bazel +++ b/packages/core/schematics/migrations/google3/BUILD.bazel @@ -4,7 +4,7 @@ ts_library( name = "google3", srcs = glob(["**/*.ts"]), tsconfig = "//packages/core/schematics:tsconfig.json", - visibility = ["//packages/core/schematics/test:__pkg__"], + visibility = ["//packages/core/schematics/test/google3:__pkg__"], deps = [ "//packages/core/schematics/migrations/injectable-pipe", "//packages/core/schematics/migrations/missing-injectable", diff --git a/packages/core/schematics/migrations/renderer-to-renderer2/google3/BUILD.bazel b/packages/core/schematics/migrations/renderer-to-renderer2/google3/BUILD.bazel index d1772f9b2b..9b5b5db39f 100644 --- a/packages/core/schematics/migrations/renderer-to-renderer2/google3/BUILD.bazel +++ b/packages/core/schematics/migrations/renderer-to-renderer2/google3/BUILD.bazel @@ -4,7 +4,7 @@ ts_library( name = "google3", srcs = glob(["**/*.ts"]), tsconfig = "//packages/core/schematics:tsconfig.json", - visibility = ["//packages/core/schematics/test:__pkg__"], + visibility = ["//packages/core/schematics/test/google3:__pkg__"], deps = [ "//packages/core/schematics/migrations/renderer-to-renderer2", "@npm//tslint", diff --git a/packages/core/schematics/test/BUILD.bazel b/packages/core/schematics/test/BUILD.bazel index cacb572f91..421d825526 100644 --- a/packages/core/schematics/test/BUILD.bazel +++ b/packages/core/schematics/test/BUILD.bazel @@ -9,12 +9,10 @@ ts_library( "//packages/core/schematics:migrations.json", ], deps = [ - "//packages/core/schematics/migrations/google3", "//packages/core/schematics/migrations/injectable-pipe", "//packages/core/schematics/migrations/missing-injectable", "//packages/core/schematics/migrations/move-document", "//packages/core/schematics/migrations/renderer-to-renderer2", - "//packages/core/schematics/migrations/renderer-to-renderer2/google3", "//packages/core/schematics/migrations/static-queries", "//packages/core/schematics/migrations/template-var-assignment", "//packages/core/schematics/utils", @@ -26,7 +24,7 @@ ts_library( ) jasmine_node_test( - name = "test", + name = "google3", deps = [ ":test_lib", "@npm//shelljs", diff --git a/packages/core/schematics/test/google3/BUILD.bazel b/packages/core/schematics/test/google3/BUILD.bazel new file mode 100644 index 0000000000..9fba95bc3d --- /dev/null +++ b/packages/core/schematics/test/google3/BUILD.bazel @@ -0,0 +1,21 @@ +load("//tools:defaults.bzl", "jasmine_node_test", "ts_library") + +ts_library( + name = "test_lib", + testonly = True, + srcs = glob(["**/*.ts"]), + deps = [ + "//packages/core/schematics/migrations/google3", + "//packages/core/schematics/migrations/renderer-to-renderer2/google3", + "@npm//@types/shelljs", + "@npm//tslint", + ], +) + +jasmine_node_test( + name = "test", + deps = [ + ":test_lib", + "@npm//shelljs", + ], +)