Add target platform as input to compilation target analysis.

Platform entries in trybot_analyze_config.json were not being used. The
chromium_tests module will now read the entry corresponding to the
target platform by default.

Bug: 1122702
Change-Id: Icf90aa698e7c78f1427a940c06c44dacce598fb4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/build/+/2521906
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: Sajjad Mirza <sajjadm@chromium.org>
diff --git a/recipes/recipe_modules/chromium_tests/api.py b/recipes/recipe_modules/chromium_tests/api.py
index d7b2c37..f2e4838 100644
--- a/recipes/recipe_modules/chromium_tests/api.py
+++ b/recipes/recipe_modules/chromium_tests/api.py
@@ -1740,6 +1740,7 @@
       mb_config_path = (
           self.m.chromium.c.project_generator.config_path or
           self.m.path['checkout'].join('tools', 'mb', 'mb_config.pyl'))
+      analyze_names.append(self.m.chromium.c.TARGET_PLATFORM)
       test_targets, compile_targets = self.m.filter.analyze(
           affected_files,
           test_targets,
diff --git a/recipes/recipe_modules/filter/api.py b/recipes/recipe_modules/filter/api.py
index 60d0527..8ba5351 100644
--- a/recipes/recipe_modules/filter/api.py
+++ b/recipes/recipe_modules/filter/api.py
@@ -168,7 +168,8 @@
     config_contents = self._load_analyze_config(config_file_name)
     exclusions = []
     ignores = []
-    for name in names:
+    valid_names = [name for name in names if name in config_contents]
+    for name in valid_names:
       exclusions.extend(config_contents[name].get('exclusions', []))
       ignores.extend(config_contents[name].get('ignores', []))