diff options
| author | 2023-02-26 21:15:25 -0800 | |
|---|---|---|
| committer | 2023-02-28 11:31:15 -0800 | |
| commit | 1021ccda6b7c2a8737b4468c215a73ccd99b5cb0 (patch) | |
| tree | 08a8029456d9d280997814dc2ecbac2358991892 /java/lint_test.go | |
| parent | 8ecedd4dfc3ccd1c2a4c384e9a6de3906a33a1b4 (diff) | |
Disable strict_updatability_linting
strict_updatability_linting currently only makes it so
that NewApi can't be added to the lint baseline.
However, since we're updating NewApi to work on a lot
more apis than before, we need to baseline many issues
across the android tree. Temporarily disable
strict_updatability_linting so that we can add these
baselines.
Bug: 193460475
Test: Presubmits
Change-Id: I8d92df95a46e9b903f0cc0e3be56f17722c50430
Diffstat (limited to 'java/lint_test.go')
| -rw-r--r-- | java/lint_test.go | 91 |
1 files changed, 46 insertions, 45 deletions
diff --git a/java/lint_test.go b/java/lint_test.go index 62450d573..1ab416c9e 100644 --- a/java/lint_test.go +++ b/java/lint_test.go @@ -174,51 +174,52 @@ func TestJavaLintBypassUpdatableChecks(t *testing.T) { } } -func TestJavaLintStrictUpdatabilityLinting(t *testing.T) { - bp := ` - java_library { - name: "foo", - srcs: [ - "a.java", - ], - static_libs: ["bar"], - min_sdk_version: "29", - sdk_version: "current", - lint: { - strict_updatability_linting: true, - }, - } - - java_library { - name: "bar", - srcs: [ - "a.java", - ], - min_sdk_version: "29", - sdk_version: "current", - } - ` - fs := android.MockFS{ - "lint-baseline.xml": nil, - } - - result := android.GroupFixturePreparers(PrepareForTestWithJavaDefaultModules, fs.AddToFixture()). - RunTestWithBp(t, bp) - - foo := result.ModuleForTests("foo", "android_common") - sboxProto := android.RuleBuilderSboxProtoForTests(t, foo.Output("lint.sbox.textproto")) - if !strings.Contains(*sboxProto.Commands[0].Command, - "--baseline lint-baseline.xml --disallowed_issues NewApi") { - t.Error("did not restrict baselining NewApi") - } - - bar := result.ModuleForTests("bar", "android_common") - sboxProto = android.RuleBuilderSboxProtoForTests(t, bar.Output("lint.sbox.textproto")) - if !strings.Contains(*sboxProto.Commands[0].Command, - "--baseline lint-baseline.xml --disallowed_issues NewApi") { - t.Error("did not restrict baselining NewApi") - } -} +// TODO(b/193460475): Re-enable this test +//func TestJavaLintStrictUpdatabilityLinting(t *testing.T) { +// bp := ` +// java_library { +// name: "foo", +// srcs: [ +// "a.java", +// ], +// static_libs: ["bar"], +// min_sdk_version: "29", +// sdk_version: "current", +// lint: { +// strict_updatability_linting: true, +// }, +// } +// +// java_library { +// name: "bar", +// srcs: [ +// "a.java", +// ], +// min_sdk_version: "29", +// sdk_version: "current", +// } +// ` +// fs := android.MockFS{ +// "lint-baseline.xml": nil, +// } +// +// result := android.GroupFixturePreparers(PrepareForTestWithJavaDefaultModules, fs.AddToFixture()). +// RunTestWithBp(t, bp) +// +// foo := result.ModuleForTests("foo", "android_common") +// sboxProto := android.RuleBuilderSboxProtoForTests(t, foo.Output("lint.sbox.textproto")) +// if !strings.Contains(*sboxProto.Commands[0].Command, +// "--baseline lint-baseline.xml --disallowed_issues NewApi") { +// t.Error("did not restrict baselining NewApi") +// } +// +// bar := result.ModuleForTests("bar", "android_common") +// sboxProto = android.RuleBuilderSboxProtoForTests(t, bar.Output("lint.sbox.textproto")) +// if !strings.Contains(*sboxProto.Commands[0].Command, +// "--baseline lint-baseline.xml --disallowed_issues NewApi") { +// t.Error("did not restrict baselining NewApi") +// } +//} func TestJavaLintDatabaseSelectionFull(t *testing.T) { testCases := []string{ |