Skip to content

Commit e6aaf3e

Browse files
avargitster
authored andcommitted
CI: pre-select test slice in Windows & VS tests
In preceding commits the tests have been changed to do their setup via $GITHUB_ENV in one step, and to then have subsequent steps that re-use that environment. Let's change the "test slice" tests added in b819f1d (ci: parallelize testing on Windows, 2019-01-29) to do the same. These tests select 10% of the tests to run in 10 "test slices". Now we'll select those in a step that immediately precedes the testing step, and then simply invoke "make -C t -e". This has the advantage that the tests to be run are now listed in the standard "Run" drop-down at the start of the "test" step. Since the "T" variable in "t/Makefile" doesn't normally accept overrides from the environment we need to invoke "make" with the "-e" option (a.k.a. "--environment-overrides"). We could also make $(T) in t/Makefile be a "?=" assigned variable, but this way works, and is arguably clearer as it's more obvious that we're injecting a special list of tests that override the normal behavior of that Makefile. Note that we cannot run the top-level "make test" here, because of how the Windows CI builds git, i.e. either via CMake or some option that would cause "make test" to recompile git itself. Instead we run "make -C t [...]". Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent f5f6f73 commit e6aaf3e

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

.github/workflows/main.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,12 @@ jobs:
124124
- uses: git-for-windows/setup-git-for-windows-sdk@v1
125125
- run: ci/lib.sh
126126
shell: bash
127+
- name: select tests
128+
run: . /etc/profile && ci/select-test-slice.sh ${{matrix.nr}} 10
129+
shell: bash
127130
- name: test
128131
shell: bash
129-
run: . /etc/profile && ci/run-test-slice.sh ${{matrix.nr}} 10
132+
run: . /etc/profile && make -C t -e
130133
- name: ci/print-test-failures.sh
131134
if: failure()
132135
shell: bash
@@ -210,9 +213,12 @@ jobs:
210213
run: tar xf artifacts.tar.gz && tar xf tracked.tar.gz
211214
- run: ci/lib.sh
212215
shell: bash
216+
- name: select tests
217+
run: . /etc/profile && ci/select-test-slice.sh ${{matrix.nr}} 10
218+
shell: bash
213219
- name: test
214220
shell: bash
215-
run: . /etc/profile && ci/run-test-slice.sh ${{matrix.nr}} 10
221+
run: . /etc/profile && make -C t -e
216222
- name: ci/print-test-failures.sh
217223
if: failure()
218224
shell: bash
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/bin/sh
22
#
3-
# Test Git in parallel
3+
# Select a portion of the tests for testing Git in parallel
44
#
55

66
. ${0%/*}/lib.sh
77

88
tests=$(echo $(cd t && ./helper/test-tool path-utils slice-tests "$1" "$2" \
99
t[0-9]*.sh))
10-
make --quiet -C t T="$tests"
10+
echo T="$tests" >>$GITHUB_ENV

0 commit comments

Comments
 (0)