This is an automated email from the ASF dual-hosted git repository.

pabloem pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new cf8af05  Merge pull request #16701 from [BEAM-13786] [Playground] 
[Bugfix] Update CI/CD to verify only single-file examples
cf8af05 is described below

commit cf8af0588d67de0740334dcf6d6e4488a4394320
Author: Pavel Avilov <[email protected]>
AuthorDate: Tue Feb 8 00:24:57 2022 +0300

    Merge pull request #16701 from [BEAM-13786] [Playground] [Bugfix] Update 
CI/CD to verify only single-file examples
    
    * Update CI/CD to verify only single-file examples
    
    * Refactoring code
    
    * list comprehension to filter
---
 playground/infrastructure/cd_helper.py | 11 +++++++----
 playground/infrastructure/ci_cd.py     |  7 ++++---
 playground/infrastructure/ci_helper.py |  8 +++++---
 3 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/playground/infrastructure/cd_helper.py 
b/playground/infrastructure/cd_helper.py
index 1f46401..e2e8599 100644
--- a/playground/infrastructure/cd_helper.py
+++ b/playground/infrastructure/cd_helper.py
@@ -41,14 +41,17 @@ class CDHelper:
 
   It is used to save beam examples/katas/tests and their output on the GCS.
   """
-
   def store_examples(self, examples: List[Example]):
     """
     Store beam examples and their output in the Google Cloud.
+
+    Outputs for multifile examples are left empty.
     """
-    logging.info("Start of executing Playground examples ...")
-    asyncio.run(self._get_outputs(examples))
-    logging.info("Finish of executing Playground examples")
+    single_file_examples = list(filter(
+      lambda example: example.tag.multifile is False, examples))
+    logging.info("Start of executing only single-file Playground examples ...")
+    asyncio.run(self._get_outputs(single_file_examples))
+    logging.info("Finish of executing single-file Playground examples")
 
     logging.info("Start of sending Playground examples to the bucket ...")
     self._save_to_cloud_storage(examples)
diff --git a/playground/infrastructure/ci_cd.py 
b/playground/infrastructure/ci_cd.py
index 1d94e0c..3517113 100644
--- a/playground/infrastructure/ci_cd.py
+++ b/playground/infrastructure/ci_cd.py
@@ -51,7 +51,7 @@ categories_file = os.getenv("BEAM_EXAMPLE_CATEGORIES")
 
 def _ci_step(examples: List[Example]):
   """
-  CI step to verify all beam examples/tests/katas
+  CI step to verify single-file beam examples/tests/katas
   """
 
   ci_helper = CIHelper()
@@ -84,9 +84,10 @@ def _run_ci_cd(step: config.Config.CI_CD_LITERAL, sdk: Sdk):
   logging.info("Number of found Playground examples: %s", len(examples))
 
   if step == config.Config.CI_STEP_NAME:
-    logging.info("Start of verification Playground examples ...")
+    logging.info(
+        "Start of verification only single_file Playground examples ...")
     _ci_step(examples=examples)
-    logging.info("Finish of verification Playground examples")
+    logging.info("Finish of verification single_file Playground examples")
   if step == config.Config.CD_STEP_NAME:
     logging.info("Start of storing Playground examples ...")
     _cd_step(examples=examples)
diff --git a/playground/infrastructure/ci_helper.py 
b/playground/infrastructure/ci_helper.py
index 9ae3cc5..1792155 100644
--- a/playground/infrastructure/ci_helper.py
+++ b/playground/infrastructure/ci_helper.py
@@ -43,10 +43,12 @@ class CIHelper:
 
     1. Find all beam examples starting from directory 
os.getenv("BEAM_ROOT_DIR")
     2. Group code of examples by their SDK.
-    3. Run processing for all examples to verify examples' code.
+    3. Run processing for single-file examples to verify examples' code.
     """
-    await get_statuses(examples)
-    await self._verify_examples(examples)
+    single_file_examples = list(filter(
+      lambda example: example.tag.multifile is False, examples))
+    await get_statuses(single_file_examples)
+    await self._verify_examples(single_file_examples)
 
   async def _verify_examples(self, examples: List[Example]):
     """

Reply via email to