validate:launcher: Sync asset only when passing --sync
authorThibault Saunier <tsaunier@igalia.com>
Sat, 2 Oct 2021 14:58:56 +0000 (11:58 -0300)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 6 Oct 2021 17:00:54 +0000 (17:00 +0000)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1020>

.gitlab-ci.yml
subprojects/gst-devtools/validate/launcher/main.py
subprojects/gst-integration-testsuites/testsuites/ges.py
subprojects/gst-integration-testsuites/testsuites/validate.py

index b70e4060d2640c4705a00770bf2c2f2063343062..1b0bf60c00ab2a52a9925e1df39345fab5c48284 100644 (file)
@@ -521,7 +521,7 @@ integration testsuites fedora:
   extends: '.test fedora x86_64'
   parallel: 4
   variables:
-    EXTRA_VALIDATE_ARGS: "--timeout-factor=2 --retry-on-failures --check-bugs --parts=${CI_NODE_TOTAL} --part-index=${CI_NODE_INDEX}"
+    EXTRA_VALIDATE_ARGS: "--timeout-factor=2 --retry-on-failures --check-bugs --parts=${CI_NODE_TOTAL} --part-index=${CI_NODE_INDEX} --sync"
     TEST_SUITE: "validate ges"
 
 # gstreamer-full:
index b56ca0781546269ca5788b1c58ca7a635e6de200..5f9cd5ff55bfda3c3de5cf83f33da911171ff7d2 100644 (file)
@@ -626,17 +626,6 @@ def setup_launcher_from_args(args, main_options=None):
     if options.remote_assets_url and options.sync and not os.path.exists(options.clone_dir):
         if not download_assets(options):
             return False, None, None
-
-    for d in options.testsuites_dirs:
-        path = pathlib.Path(d).resolve()
-        if not path.as_posix().endswith('subprojects/gst-integration-testsuites/testsuites'):
-            continue
-
-        # Ensure we have gst-integration-testsuites media files.
-        subprocess.check_call(['git', 'submodule', 'update', '--init'],
-                              cwd=utils.DEFAULT_GST_QA_ASSETS)
-        subprocess.check_call(['git', 'lfs', 'pull', '--exclude='],
-                              cwd=pathlib.Path(utils.DEFAULT_GST_QA_ASSETS) / 'medias')
     # Ensure that the scenario manager singleton is ready to be used
     ScenarioManager().config = options
     if not tests_launcher.set_settings(options, []):
index 4413421e6d48709736513b20e472deb83a86c973..97b6f15bde1aa5ef189b6b39e91ef173665ac908 100644 (file)
 The GES GstValidate default testsuite
 """
 import os
+import pathlib
+import subprocess
+from launcher import utils
 from testsuiteutils import update_assets
 from ges_known_issues import KNOWN_ISSUES
 
 
 TEST_MANAGER = "ges"
 
+
 def setup_tests(test_manager, options):
-    assets_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "medias", "defaults"))
+    assets_dir = os.path.abspath(os.path.join(
+        os.path.dirname(__file__), "..", "medias", "defaults"))
     if options.sync:
-        if not update_assets(options, assets_dir):
-            return False
+        if not utils.USING_SUBPROJECT:
+            if not update_assets(options, assets_dir):
+                return False
+        else:
+            print("Syncing gst-integration-testsuites media files")
+            subprocess.check_call(['git', 'submodule', 'update', '--init'],
+                                  cwd=utils.DEFAULT_GST_QA_ASSETS)
+            subprocess.check_call(['git', 'lfs', 'pull', '--exclude='],
+                                  cwd=pathlib.Path(utils.DEFAULT_GST_QA_ASSETS) / 'medias')
     options.add_paths(os.path.abspath(os.path.join(os.path.dirname(__file__),
                                                    "..", "medias", "defaults")))
     projects_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "ges",
                                                  "ges-projects"))
     scenarios_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "ges",
-                                                 "scenarios"))
+                                                  "scenarios"))
     test_manager.add_expected_issues(KNOWN_ISSUES)
     test_manager.register_defaults(projects_path, scenarios_path)
     return True
index fadce42f9b0adec10cc7b9c7dcbe73b342d1923c..bb5327d97f4fef1ea7305d435fa342b20f319444 100644 (file)
@@ -23,9 +23,12 @@ The GstValidate default testsuite
 
 import os
 import glob
+import pathlib
 import re
+import subprocess
 
 from testsuiteutils import update_assets
+from launcher import utils
 from launcher.baseclasses import MediaFormatCombination
 from launcher.apps.gstvalidate import GstValidateSimpleTestsGenerator
 from validate_known_issues import KNOWN_ISSUES
@@ -98,8 +101,15 @@ def setup_tests(test_manager, options):
 
     assets_dir = os.path.realpath(os.path.join(testsuite_dir, os.path.pardir, "medias", "defaults"))
     if options.sync:
-        if not update_assets(options, assets_dir):
-            return False
+        if not utils.USING_SUBPROJECT:
+            if not update_assets(options, assets_dir):
+                return False
+        else:
+            print("Syncing gst-integration-testsuites media files")
+            subprocess.check_call(['git', 'submodule', 'update', '--init'],
+                                cwd=utils.DEFAULT_GST_QA_ASSETS)
+            subprocess.check_call(['git', 'lfs', 'pull', '--exclude='],
+                                cwd=pathlib.Path(utils.DEFAULT_GST_QA_ASSETS) / 'medias')
 
     options.add_paths(assets_dir)
     options.set_http_server_dir(media_dir)