Skip to content

Commit c352e56

Browse files
authored
Merge pull request libgit2#4943 from libgit2/ethomson/ci
ci: only run invasive tests in nightly
2 parents 4e0c8a1 + e2b9f56 commit c352e56

File tree

6 files changed

+70
-21
lines changed

6 files changed

+70
-21
lines changed

azure-pipelines/coverity.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
resources:
2+
- repo: self
3+
4+
- job: coverity
5+
displayName: 'Coverity'
6+
pool:
7+
vmImage: 'Ubuntu 16.04'
8+
steps:
9+
- task: Docker@0
10+
displayName: Build
11+
inputs:
12+
action: 'Run an image'
13+
imageName: 'libgit2/trusty-openssl:latest'
14+
volumes: |
15+
$(Build.SourcesDirectory):/src
16+
$(Build.BinariesDirectory):/build
17+
envVars: |
18+
COVERITY_TOKEN=$(COVERITY_TOKEN)
19+
workDir: '/build'
20+
containerCommand: '/src/ci/coverity.sh'
21+
detached: false

azure-pipelines/nightly.yml

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
CC=gcc
1515
CMAKE_OPTIONS=-DUSE_HTTPS=OpenSSL
1616
LEAK_CHECK=valgrind
17+
RUN_INVASIVE_TESTS=true
1718
1819
- job: linux_amd64_trusty_gcc_mbedtls
1920
displayName: 'Linux (amd64; Trusty; GCC; mbedTLS)'
@@ -27,6 +28,7 @@ jobs:
2728
CC=gcc
2829
CMAKE_OPTIONS=-DUSE_HTTPS=mbedTLS -DSHA1_BACKEND=mbedTLS
2930
LEAK_CHECK=valgrind
31+
RUN_INVASIVE_TESTS=true
3032
3133
- job: linux_amd64_trusty_clang_openssl
3234
displayName: 'Linux (amd64; Trusty; Clang; OpenSSL)'
@@ -40,6 +42,7 @@ jobs:
4042
CC=clang
4143
CMAKE_OPTIONS=-DUSE_HTTPS=OpenSSL
4244
LEAK_CHECK=valgrind
45+
RUN_INVASIVE_TESTS=true
4346
4447
- job: linux_amd64_trusty_clang_mbedtls
4548
displayName: 'Linux (amd64; Trusty; Clang; mbedTLS)'
@@ -53,6 +56,7 @@ jobs:
5356
CC=clang
5457
CMAKE_OPTIONS=-DUSE_HTTPS=mbedTLS -DSHA1_BACKEND=mbedTLS
5558
LEAK_CHECK=valgrind
59+
RUN_INVASIVE_TESTS=true
5660
5761
- job: macos
5862
displayName: 'macOS'
@@ -68,6 +72,7 @@ jobs:
6872
PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig
6973
LEAK_CHECK: leaks
7074
CMAKE_OPTIONS: -G Ninja
75+
RUN_INVASIVE_TESTS: true
7176

7277
- job: windows_vs_amd64
7378
displayName: 'Windows (amd64; Visual Studio)'
@@ -77,6 +82,7 @@ jobs:
7782
parameters:
7883
environmentVariables:
7984
CMAKE_OPTIONS: -DMSVC_CRTDBG=ON -G"Visual Studio 12 2013 Win64"
85+
RUN_INVASIVE_TESTS: true
8086

8187
- job: windows_vs_x86
8288
displayName: 'Windows (x86; Visual Studio)'
@@ -86,6 +92,7 @@ jobs:
8692
parameters:
8793
environmentVariables:
8894
CMAKE_OPTIONS: -DMSVC_CRTDBG=ON -G"Visual Studio 12 2013"
95+
RUN_INVASIVE_TESTS: true
8996

9097
- job: windows_mingw_amd64
9198
displayName: 'Windows (amd64; MinGW)'
@@ -101,6 +108,7 @@ jobs:
101108
environmentVariables:
102109
CMAKE_OPTIONS: -G"MinGW Makefiles"
103110
PATH: $(Agent.TempDirectory)\mingw64\bin;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\CMake\bin
111+
RUN_INVASIVE_TESTS: true
104112

105113
- job: windows_mingw_x86
106114
displayName: 'Windows (x86; MinGW)'
@@ -117,6 +125,7 @@ jobs:
117125
environmentVariables:
118126
CMAKE_OPTIONS: -G"MinGW Makefiles"
119127
PATH: $(Agent.TempDirectory)\mingw32\bin;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\CMake\bin
128+
RUN_INVASIVE_TESTS: true
120129

121130
- job: linux_x86_bionic_gcc_openssl
122131
displayName: 'Linux (x86; Bionic; GCC; OpenSSL)'
@@ -131,6 +140,7 @@ jobs:
131140
CC=gcc
132141
CMAKE_OPTIONS=-DUSE_HTTPS=OpenSSL
133142
LEAK_CHECK=valgrind
143+
RUN_INVASIVE_TESTS=true
134144
135145
- job: linux_x86_bionic_clang_openssl
136146
displayName: 'Linux (x86; Bionic; Clang; OpenSSL)'
@@ -145,6 +155,7 @@ jobs:
145155
CC=clang
146156
CMAKE_OPTIONS=-DUSE_HTTPS=OpenSSL
147157
LEAK_CHECK=valgrind
158+
RUN_INVASIVE_TESTS=true
148159
149160
- job: linux_arm32_bionic_gcc_openssl
150161
displayName: 'Linux (arm32; Bionic; GCC; OpenSSL)'
@@ -158,6 +169,7 @@ jobs:
158169
environmentVariables: |
159170
CC=gcc
160171
CMAKE_OPTIONS=-DUSE_HTTPS=OpenSSL
172+
RUN_INVASIVE_TESTS=true
161173
SKIP_PROXY_TESTS=true
162174
163175
- job: linux_arm64_bionic_gcc_openssl
@@ -172,23 +184,5 @@ jobs:
172184
environmentVariables: |
173185
CC=gcc
174186
CMAKE_OPTIONS=-DUSE_HTTPS=OpenSSL
187+
RUN_INVASIVE_TESTS=true
175188
SKIP_PROXY_TESTS=true
176-
177-
- job: coverity
178-
displayName: 'Coverity'
179-
pool:
180-
vmImage: 'Ubuntu 16.04'
181-
steps:
182-
- task: Docker@0
183-
displayName: Build
184-
inputs:
185-
action: 'Run an image'
186-
imageName: 'libgit2/trusty-openssl:latest'
187-
volumes: |
188-
$(Build.SourcesDirectory):/src
189-
$(Build.BinariesDirectory):/build
190-
envVars: |
191-
COVERITY_TOKEN=$(COVERITY_TOKEN)
192-
workDir: '/build'
193-
containerCommand: '/src/ci/coverity.sh'
194-
detached: false

ci/test.ps1

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,21 @@ Write-Host "####################################################################
5151

5252
run_test offline
5353

54+
if ($Env:RUN_INVASIVE_TESTS) {
55+
Write-Host ""
56+
Write-Host "##############################################################################"
57+
Write-Host "## Running (invasive) tests"
58+
Write-Host "##############################################################################"
59+
60+
$Env:GITTEST_INVASIVE_FS_SIZE=1
61+
$Env:GITTEST_INVASIVE_MEMORY=1
62+
$Env:GITTEST_INVASIVE_SPEED=1
63+
run_test invasive
64+
$Env:GITTEST_INVASIVE_FS_SIZE=$null
65+
$Env:GITTEST_INVASIVE_MEMORY=$null
66+
$Env:GITTEST_INVASIVE_SPEED=$null
67+
}
68+
5469
if (-not $Env:SKIP_ONLINE_TESTS) {
5570
Write-Host ""
5671
Write-Host "##############################################################################"
@@ -71,6 +86,10 @@ if (-not $Env:SKIP_PROXY_TESTS) {
7186

7287
run_test proxy
7388

89+
$Env:GITTEST_REMOTE_PROXY_HOST=$null
90+
$Env:GITTEST_REMOTE_PROXY_USER=$null
91+
$Env:GITTEST_REMOTE_PROXY_PASS=$null
92+
7493
taskkill /F /IM javaw.exe
7594
}
7695

ci/test.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,20 @@ if [ -z "$SKIP_OFFLINE_TESTS" ]; then
136136
run_test offline
137137
fi
138138

139+
if [ -n "$RUN_INVASIVE_TESTS" ]; then
140+
echo ""
141+
echo "Running invasive tests"
142+
echo ""
143+
144+
export GITTEST_INVASIVE_FS_SIZE=1
145+
export GITTEST_INVASIVE_MEMORY=1
146+
export GITTEST_INVASIVE_SPEED=1
147+
run_test invasive
148+
unset GITTEST_INVASIVE_FS_SIZE
149+
unset GITTEST_INVASIVE_MEMORY
150+
unset GITTEST_INVASIVE_SPEED
151+
fi
152+
139153
if [ -z "$SKIP_ONLINE_TESTS" ]; then
140154
# Run the various online tests. The "online" test suite only includes the
141155
# default online tests that do not require additional configuration. The

tests/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ IF (MSVC_IDE)
5555
ENDIF ()
5656

5757
ADD_TEST(offline "${libgit2_BINARY_DIR}/libgit2_clar" -v -xonline)
58+
ADD_TEST(invasive "${libgit2_BINARY_DIR}/libgit2_clar" -v -score::ftruncate -sfilter::stream::bigfile -sodb::largefiles -siterator::workdir::filesystem_gunk -srepo::init -srepo::init::at_filesystem_root)
5859
ADD_TEST(online "${libgit2_BINARY_DIR}/libgit2_clar" -v -sonline)
5960
ADD_TEST(gitdaemon "${libgit2_BINARY_DIR}/libgit2_clar" -v -sonline::push)
6061
ADD_TEST(ssh "${libgit2_BINARY_DIR}/libgit2_clar" -v -sonline::push -sonline::clone::ssh_cert -sonline::clone::ssh_with_paths)

tests/iterator/workdir.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -661,10 +661,10 @@ void test_iterator_workdir__filesystem_gunk(void)
661661

662662
cl_git_pass(git_iterator_for_filesystem(&i, "testrepo/.git/refs", NULL));
663663

664-
/* should only have 13 items, since we're not asking for trees to be
664+
/* should only have 16 items, since we're not asking for trees to be
665665
* returned. the goal of this test is simply to not crash.
666666
*/
667-
expect_iterator_items(i, 15, NULL, 15, NULL);
667+
expect_iterator_items(i, 16, NULL, 15, NULL);
668668
git_iterator_free(i);
669669
git_buf_dispose(&parent);
670670
}

0 commit comments

Comments
 (0)