From e171387d4c2ab18173dbea4061499f0f39443ce3 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 13 Nov 2025 12:21:11 +0100 Subject: [PATCH] CMake: Modify the RunCMake tests to clone from the Coin CI git mirror This helps with the test stability when code.qt.io is down or slow. Pick-to: 6.10 Change-Id: I0bdaaa06772a94e73cb33d3f827e4e327123b60a Reviewed-by: Joerg Bornemann (cherry picked from commit 160e6135bb40f19b540e022b2c51b174f6dfb59b) Reviewed-by: Qt Cherry-pick Bot --- .../RunCMake/ConfigureBuildQt/Utils.cmake | 20 +++++++++------ .../InitRepository/0030_ir_qtsvg-stdout.txt | 4 +-- .../0050_ir_existing-stdout.txt | 2 +- .../0060_ir_shadertools_and_svg-stdout.txt | 6 ++--- .../0070_ir_qttools_with_deps-stdout.txt | 16 ++++++------ .../InitRepository/RunCMakeTest.cmake | 25 ++++++++++++++----- 6 files changed, 45 insertions(+), 28 deletions(-) diff --git a/tests/manual/RunCMake/ConfigureBuildQt/Utils.cmake b/tests/manual/RunCMake/ConfigureBuildQt/Utils.cmake index 0e262762..ea37e6d2 100644 --- a/tests/manual/RunCMake/ConfigureBuildQt/Utils.cmake +++ b/tests/manual/RunCMake/ConfigureBuildQt/Utils.cmake @@ -246,16 +246,22 @@ function(setup_qt_sources) set(RunCMake_TEST_COMMAND_WORKING_DIRECTORY "${working_dir}") - set(code_qt_io_mirror "https://code.qt.io/qt/qt5.git") set(gerrit_mirror "https://codereview.qt-project.org/qt/qt5") + get_repo_base_url(ci_repo_base_url) + set(remote_clone_url "${ci_repo_base_url}/qt/qt5.git") # Make a copy of the qt6 repo on which the test will operate on. - # On the CI we clone it from the official mirror, because we don't have a git repo, but only - # a source archive. - # On a local build we use the current qt6 checkout. + # On the CI we clone qt6 from one of the following sources, in order: + # - the Coin CI git mirror + # - or the remote specified by QT_CI_BUILD_QT_GIT_REMOTE + # - or from code.qt.io + # We do a clone, because 'local_clone_url' is usually not a git repo in the CI, + # but only a source archive. + # On a local build where a ci_ref is not specified, we use the current qt6 checkout + # from 'local_clone_url'. set(ci_ref "$ENV{TESTED_MODULE_REVISION_COIN}") if(ci_ref) - set(final_clone_url "${code_qt_io_mirror}") + set(final_clone_url "${remote_clone_url}") else() set(final_clone_url "${local_clone_url}") endif() @@ -295,9 +301,7 @@ function(setup_qt_sources) SYMBOLIC) endforeach() else() - # Adjust its remote url not to be the local url. - get_repo_base_url(repo_base_url) - set(remote_clone_url "${repo_base_url}/qt/qt5.git") + # Adjust its remote url to be the chosen mirror rather the local url. run_command("${prefix}" set_remote_url git remote set-url origin "${remote_clone_url}") # Sync to given module. diff --git a/tests/manual/RunCMake/InitRepository/0030_ir_qtsvg-stdout.txt b/tests/manual/RunCMake/InitRepository/0030_ir_qtsvg-stdout.txt index 6c380b96..b6fe9450 100644 --- a/tests/manual/RunCMake/InitRepository/0030_ir_qtsvg-stdout.txt +++ b/tests/manual/RunCMake/InitRepository/0030_ir_qtsvg-stdout.txt @@ -1,7 +1,7 @@ \+ git submodule init qtsvg -Submodule 'qtsvg' \(https://code.qt.io/qt/qtsvg.git\) registered for path 'qtsvg' +Submodule 'qtsvg' \(.+/qtsvg.git\) registered for path 'qtsvg' \+ git config commit.template .+tmp.+/qt6/.commit-template -\+ git clone --no-checkout https://code.qt.io/qt/qtsvg.git qtsvg +\+ git clone --no-checkout .+/qt/qtsvg.git qtsvg Cloning into 'qtsvg'... \+ git config commit.template .+tmp.+/qt6/.commit-template \+ git config remote.gerrit.url ssh://codereview.qt-project.org/qt/qtsvg.git diff --git a/tests/manual/RunCMake/InitRepository/0050_ir_existing-stdout.txt b/tests/manual/RunCMake/InitRepository/0050_ir_existing-stdout.txt index 16d66bc5..1050d1f0 100644 --- a/tests/manual/RunCMake/InitRepository/0050_ir_existing-stdout.txt +++ b/tests/manual/RunCMake/InitRepository/0050_ir_existing-stdout.txt @@ -1,6 +1,6 @@ \+ git submodule init qtsvg \+ git config commit.template .+tmp.+/qt6/.commit-template -\+ git config remote.origin.url https://code.qt.io/qt/qtsvg.git +\+ git config remote.origin.url .+/qt/qtsvg.git \+ git fetch origin \+ git config commit.template .+tmp.+/qt6/.commit-template \+ git config remote.gerrit.url ssh://codereview.qt-project.org/qt/qtsvg.git diff --git a/tests/manual/RunCMake/InitRepository/0060_ir_shadertools_and_svg-stdout.txt b/tests/manual/RunCMake/InitRepository/0060_ir_shadertools_and_svg-stdout.txt index 7e2e12e5..5b551b49 100644 --- a/tests/manual/RunCMake/InitRepository/0060_ir_shadertools_and_svg-stdout.txt +++ b/tests/manual/RunCMake/InitRepository/0060_ir_shadertools_and_svg-stdout.txt @@ -1,12 +1,12 @@ \+ git submodule init qtshadertools qtsvg -Submodule 'qtshadertools' \(https://code.qt.io/qt/qtshadertools.git\) registered for path 'qtshadertools' +Submodule 'qtshadertools' \(.+/qt/qtshadertools.git\) registered for path 'qtshadertools' \+ git config commit.template .+tmp.+/qt6/.commit-template -\+ git clone --no-checkout https://code.qt.io/qt/qtshadertools.git qtshadertools +\+ git clone --no-checkout .+/qt/qtshadertools.git qtshadertools Cloning into 'qtshadertools'... \+ git config commit.template .+tmp.+/qt6/.commit-template \+ git config remote.gerrit.url ssh://codereview.qt-project.org/qt/qtshadertools.git \+ git config remote.gerrit.fetch \+refs/heads/\*:refs/remotes/gerrit/\* /heads/ -\+ git config remote.origin.url https://code.qt.io/qt/qtsvg.git +\+ git config remote.origin.url .+/qt/qtsvg.git \+ git fetch origin \+ git config commit.template .+tmp.+/qt6/.commit-template \+ git config remote.gerrit.url ssh://codereview.qt-project.org/qt/qtsvg.git diff --git a/tests/manual/RunCMake/InitRepository/0070_ir_qttools_with_deps-stdout.txt b/tests/manual/RunCMake/InitRepository/0070_ir_qttools_with_deps-stdout.txt index 25f9167c..a4091aa1 100644 --- a/tests/manual/RunCMake/InitRepository/0070_ir_qttools_with_deps-stdout.txt +++ b/tests/manual/RunCMake/InitRepository/0070_ir_qttools_with_deps-stdout.txt @@ -1,24 +1,24 @@ \+ git config --get initrepository.initialized \+ git submodule init qtshadertools qtsvg qtactiveqt qttools -Submodule 'qtactiveqt' \(https://code.qt.io/qt/qtactiveqt.git\) registered for path 'qtactiveqt' -Submodule 'qttools' \(https://code.qt.io/qt/qttools.git\) registered for path 'qttools' +Submodule 'qtactiveqt' \(.+/qt/qtactiveqt.git\) registered for path 'qtactiveqt' +Submodule 'qttools' \(.+/qt/qttools.git\) registered for path 'qttools' \+ git config commit.template .+tmp.+/qt6/.commit-template -\+ git config remote.origin.url https://code.qt.io/qt/qtshadertools.git +\+ git config remote.origin.url .+/qt/qtshadertools.git \+ git fetch origin \+ git config commit.template .+tmp.+/qt6/.commit-template \+ git config remote.gerrit.url ssh://codereview.qt-project.org/qt/qtshadertools.git \+ git config remote.gerrit.fetch \+refs/heads/\*:refs/remotes/gerrit/\* /heads/ -\+ git config remote.origin.url https://code.qt.io/qt/qtsvg.git +\+ git config remote.origin.url .+/qt/qtsvg.git \+ git fetch origin \+ git config commit.template .+tmp.+/qt6/.commit-template \+ git config remote.gerrit.url ssh://codereview.qt-project.org/qt/qtsvg.git \+ git config remote.gerrit.fetch \+refs/heads/\*:refs/remotes/gerrit/\* /heads/ -\+ git clone --no-checkout https://code.qt.io/qt/qtactiveqt.git qtactiveqt +\+ git clone --no-checkout .+/qt/qtactiveqt.git qtactiveqt Cloning into 'qtactiveqt'... \+ git config commit.template .+tmp.+/qt6/.commit-template \+ git config remote.gerrit.url ssh://codereview.qt-project.org/qt/qtactiveqt.git \+ git config remote.gerrit.fetch \+refs/heads/\*:refs/remotes/gerrit/\* /heads/ -\+ git clone --no-checkout https://code.qt.io/qt/qttools.git qttools +\+ git clone --no-checkout .+/qt/qttools.git qttools Cloning into 'qttools'... \+ git config commit.template .+tmp.+/qt6/.commit-template \+ git config remote.gerrit.url ssh://codereview.qt-project.org/qt/qttools.git @@ -29,8 +29,8 @@ Submodule path 'qtshadertools': checked out '[0-9a-zA-Z]+' Submodule path 'qtsvg': checked out '[0-9a-zA-Z]+' Submodule path 'qttools': checked out '[0-9a-zA-Z]+' \+ git submodule init src/assistant/qlitehtml -Submodule 'src/assistant/qlitehtml' \(https://code.qt.io/playground/qlitehtml.git\) registered for path 'src/assistant/qlitehtml' -\+ git clone --no-checkout https://code.qt.io/playground/qlitehtml.git src/assistant/qlitehtml +Submodule 'src/assistant/qlitehtml' \(.+/playground/qlitehtml.git\) registered for path 'src/assistant/qlitehtml' +\+ git clone --no-checkout .+/playground/qlitehtml.git src/assistant/qlitehtml Cloning into 'src/assistant/qlitehtml'... \+ git submodule update --force --no-fetch Submodule path 'src/assistant/qlitehtml': checked out '[0-9a-zA-Z]+' diff --git a/tests/manual/RunCMake/InitRepository/RunCMakeTest.cmake b/tests/manual/RunCMake/InitRepository/RunCMakeTest.cmake index 0886e318..1bc5e0f4 100644 --- a/tests/manual/RunCMake/InitRepository/RunCMakeTest.cmake +++ b/tests/manual/RunCMake/InitRepository/RunCMakeTest.cmake @@ -109,13 +109,27 @@ function(run_suite) set(code_qt_io_mirror "https://code.qt.io/qt/qt5.git") set(gerrit_mirror "https://codereview.qt-project.org/qt/qt5") + set(coin_git_ip_port "$ENV{QT_COIN_GIT_DAEMON}") + set(ci_mirror "git://${coin_git_ip_port}/qt-project") + set(ci_clone_url "${ci_mirror}/qt/qt5.git") + + if(coin_git_ip_port) + set(remote_clone_url "${ci_clone_url}") + else() + set(remote_clone_url "${code_qt_io_mirror}") + endif() + # Make a copy of the qt6 repo on which the test will operate on. - # On the CI we clone it from the official mirror, because we don't have a git repo, but only - # a source archive. - # On a local build we use the current qt6 checkout. + # On the CI we clone qt6 from one of the following sources, in order: + # - the Coin CI git mirror + # - or from code.qt.io + # We do a clone, because 'local_clone_url' is usually not a git repo in the CI, + # but only a source archive. + # On a local build where a ci_ref is not specified, we use the current qt6 checkout + # from 'local_clone_url'. set(ci_ref "$ENV{TESTED_MODULE_REVISION_COIN}") if(ci_ref) - set(final_clone_url "${code_qt_io_mirror}") + set(final_clone_url "${remote_clone_url}") else() set(final_clone_url "${local_clone_url}") endif() @@ -129,8 +143,7 @@ function(run_suite) run_suite_command(0012_checkout_ci_qt6_ref git checkout FETCH_HEAD --quiet) endif() - # Adjust its remote url to be the official mirror rather the local url. - set(remote_clone_url "${code_qt_io_mirror}") + # Adjust its remote url to be the chosen mirror rather the local url. run_suite_command(0020_set_qt6_remote_url git remote set-url origin "${remote_clone_url}") # Ignore certain lines