aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/main.yml8
-rw-r--r--.gitlab-ci.yml17
-rwxr-xr-xci/run-test-slice-meson.sh2
-rwxr-xr-xci/run-test-slice.sh6
-rw-r--r--t/helper/test-path-utils.c18
-rw-r--r--t/meson.build1
6 files changed, 36 insertions, 16 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index f2e93f5461..826f2f5d3a 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -150,7 +150,7 @@ jobs:
- uses: git-for-windows/setup-git-for-windows-sdk@v1
- name: test
shell: bash
- run: . /etc/profile && ci/run-test-slice.sh ${{matrix.nr}} 10
+ run: . /etc/profile && ci/run-test-slice.sh $((${{matrix.nr}} + 1)) 10
- name: print test failures
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
shell: bash
@@ -237,7 +237,7 @@ jobs:
shell: bash
env:
NO_SVN_TESTS: 1
- run: . /etc/profile && ci/run-test-slice.sh ${{matrix.nr}} 10
+ run: . /etc/profile && ci/run-test-slice.sh $((${{matrix.nr}} + 1)) 10
- name: print test failures
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
shell: bash
@@ -297,8 +297,8 @@ jobs:
name: windows-meson-artifacts
path: build
- name: Test
- shell: pwsh
- run: ci/run-test-slice-meson.sh build ${{matrix.nr}} 10
+ shell: bash
+ run: ci/run-test-slice-meson.sh build $((${{matrix.nr}} + 1)) 10
- name: print test failures
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
shell: bash
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b419a84e2c..71b8a6e642 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -157,6 +157,8 @@ test:mingw64:
parallel: 10
.msvc-meson:
+ variables:
+ TEST_OUTPUT_DIRECTORY: "C:/Git-Test"
tags:
- saas-windows-medium-amd64
before_script:
@@ -164,12 +166,13 @@ test:mingw64:
- choco install -y git meson ninja rust-ms
- Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
- refreshenv
+ - New-Item -Path $env:TEST_OUTPUT_DIRECTORY -ItemType Directory
build:msvc-meson:
extends: .msvc-meson
stage: build
script:
- - meson setup build --vsenv -Dperl=disabled -Dbackend_max_links=1 -Dcredential_helpers=wincred
+ - meson setup build --vsenv -Dperl=disabled -Dbackend_max_links=1 -Dcredential_helpers=wincred -Dtest_output_directory="$TEST_OUTPUT_DIRECTORY"
- meson compile -C build
artifacts:
paths:
@@ -183,11 +186,21 @@ test:msvc-meson:
- job: "build:msvc-meson"
artifacts: true
script:
- - meson test -C build --no-rebuild --print-errorlogs --slice $Env:CI_NODE_INDEX/$Env:CI_NODE_TOTAL
+ - |
+ & "C:/Program Files/Git/usr/bin/bash.exe" -l -c 'ci/run-test-slice-meson.sh build $CI_NODE_INDEX $CI_NODE_TOTAL'
+ after_script:
+ - |
+ if ($env:CI_JOB_STATUS -ne "success") {
+ & "C:/Program Files/Git/usr/bin/bash.exe" -l -c 'ci/print-test-failures.sh'
+ Move-Item -Path "$env:TEST_OUTPUT_DIRECTORY/failed-test-artifacts" -Destination t/
+ }
parallel: 10
artifacts:
+ paths:
+ - t/failed-test-artifacts
reports:
junit: build/meson-logs/testlog.junit.xml
+ when: on_failure
test:fuzz-smoke-tests:
image: ubuntu:latest
diff --git a/ci/run-test-slice-meson.sh b/ci/run-test-slice-meson.sh
index 961c94fba0..a6df927ba5 100755
--- a/ci/run-test-slice-meson.sh
+++ b/ci/run-test-slice-meson.sh
@@ -9,5 +9,5 @@
group "Run tests" \
meson test -C "$1" --no-rebuild --print-errorlogs \
- --test-args="$GIT_TEST_OPTS" --slice "$((1+$2))/$3" ||
+ --test-args="$GIT_TEST_OPTS" --slice "$(($2))/$3" ||
handle_failed_tests
diff --git a/ci/run-test-slice.sh b/ci/run-test-slice.sh
index 0444c79c02..ff948e397f 100755
--- a/ci/run-test-slice.sh
+++ b/ci/run-test-slice.sh
@@ -5,9 +5,9 @@
. ${0%/*}/lib.sh
-group "Run tests" make --quiet -C t T="$(cd t &&
- ./helper/test-tool path-utils slice-tests "$1" "$2" t[0-9]*.sh |
- tr '\n' ' ')" ||
+TESTS=$(cd t && ./helper/test-tool path-utils slice-tests "$1" "$2" t[0-9]*.sh)
+
+group "Run tests" make --quiet -C t T="$(echo "$TESTS" | tr '\n' ' ')" ||
handle_failed_tests
# We only have one unit test at the moment, so run it in the first slice
diff --git a/t/helper/test-path-utils.c b/t/helper/test-path-utils.c
index f5f33751da..874542ec34 100644
--- a/t/helper/test-path-utils.c
+++ b/t/helper/test-path-utils.c
@@ -477,14 +477,20 @@ int cmd__path_utils(int argc, const char **argv)
if (argc > 5 && !strcmp(argv[1], "slice-tests")) {
int res = 0;
- long offset, stride, i;
+ long slice, slices_total, i;
struct string_list list = STRING_LIST_INIT_NODUP;
struct stat st;
- offset = strtol(argv[2], NULL, 10);
- stride = strtol(argv[3], NULL, 10);
- if (stride < 1)
- stride = 1;
+ slices_total = strtol(argv[3], NULL, 10);
+ if (slices_total < 1)
+ die("there must be at least one slice, got '%s'",
+ argv[3]);
+
+ slice = strtol(argv[2], NULL, 10);
+ if (1 > slice || slice > slices_total)
+ die("slice must be in the range 1 <= slice <= %ld, got '%s'",
+ slices_total, argv[2]);
+
for (i = 4; i < argc; i++)
if (stat(argv[i], &st))
res = error_errno("Cannot stat '%s'", argv[i]);
@@ -492,7 +498,7 @@ int cmd__path_utils(int argc, const char **argv)
string_list_append(&list, argv[i])->util =
(void *)(intptr_t)st.st_size;
QSORT(list.items, list.nr, cmp_by_st_size);
- for (i = offset; i < list.nr; i+= stride)
+ for (i = slice - 1; i < list.nr; i+= slices_total)
printf("%s\n", list.items[i].string);
return !!res;
diff --git a/t/meson.build b/t/meson.build
index e5174ee575..6d91470ebc 100644
--- a/t/meson.build
+++ b/t/meson.build
@@ -1213,6 +1213,7 @@ endif
test_environment = script_environment
test_environment.set('GIT_BUILD_DIR', git_build_dir)
+test_environment.set('MERGE_TOOLS_DIR', meson.project_source_root() / 'mergetools')
foreach integration_test : integration_tests
test(fs.stem(integration_test), shell,