[build] Run all tests on recipe+integration changes

We shouldn't skip affected tests (or shard them differently) on
integration.git or recipe changes, since the affected tests analysis
will generally not be correct on those changes.

For recipes, this is because recipes are not part of the build system
and can affect the behavior of any part of a CI/CQ build. For
integration, this is because affected test analysis doesn't look at the
contents of Jiri project or package rolls.

Change-Id: I0cf5e60c1bd31dbd20d720f98ab6d2513d6bb7f7
Reviewed-on: https://fuchsia-review.googlesource.com/c/infra/recipes/+/679361
Reviewed-by: Ina Huh <ihuh@google.com>
Commit-Queue: Auto-Submit <auto-submit@fuchsia-infra.iam.gserviceaccount.com>
Fuchsia-Auto-Submit: Oliver Newman <olivernewman@google.com>
Reviewed-by: Anirudh Mathukumilli <rudymathu@google.com>
diff --git a/recipes/fuchsia/build.py b/recipes/fuchsia/build.py
index f5fa13a..1bbbfeb 100644
--- a/recipes/fuchsia/build.py
+++ b/recipes/fuchsia/build.py
@@ -397,8 +397,9 @@
             modifiers=modifiers,
             tags=spec.build.environment_tags,
             # TODO(fxbug.dev/50301): Remove "and" once rolled out.
-            use_affected_tests=use_affected_tests
-            and spec.test.affected_tests_multiply_threshold,
+            use_affected_tests=(
+                use_affected_tests and spec.test.affected_tests_multiply_threshold
+            ),
             affected_tests=affected_tests,
             affected_tests_multiply_threshold=spec.test.affected_tests_multiply_threshold,
             affected_tests_max_attempts=affected_tests_max_attempts,
@@ -407,7 +408,14 @@
             hermetic_deps=spec.test.use_cas,
             pave=spec.test.pave,
             disabled_device_types=spec.test.disabled_device_types,
-            skip_unaffected_tests=spec.test.skip_unaffected_tests,
+            skip_unaffected_tests=(
+                spec.test.skip_unaffected_tests
+                # Recipe and integration changes can impact tests in ways that
+                # aren't encompassed by affected tests analysis, so we should
+                # run all tests on such changes.
+                and not checkout.contains_integration_patch
+                and not api.recipe_testing.enabled
+            ),
         )
 
         if bb_input.gerrit_changes and should_report_multipliers: