Skip to content

Commit 46ff962

Browse files
committed
ci(ui-tests): exclude the large repository from the build artifact
In the previous commit, I added a new UI test that generates a somewhat large repository for testing the clone via SSH. Since that repository is created in the test directory, that would inflate the `ui-tests` build artifact rather dramatically. So let's create the repository outside of that directory. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent a1fb347 commit 46ff962

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

.github/workflows/ui-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ jobs:
112112
& "${env:RUNNER_TEMP}\ahk\AutoHotKey64.exe" /ErrorStdOut /force background-hook.ahk "$PWD\bg-hook" 2>&1 | Out-Default
113113
if (!$?) { $exitCode = 1; echo "::error::Test failed!" } else { echo "::notice::Test log" }
114114
type bg-hook.log
115+
$env:LARGE_FILES_DIRECTORY = "${env:RUNNER_TEMP}\large"
115116
& "${env:RUNNER_TEMP}\ahk\AutoHotKey64.exe" /ErrorStdOut /force ctrl-c.ahk "$PWD\ctrl-c" 2>&1 | Out-Default
116117
if (!$?) { $exitCode = 1; echo "::error::Ctrl+C Test failed!" } else { echo "::notice::Ctrl+C Test log" }
117118
type ctrl-c.log

ui-tests/ctrl-c.ahk

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,13 @@ WaitForRegExInWindowsTerminal('>[ `n`r]*$', 'Timed out waiting for interrupt', '
4848
openSSHPath := EnvGet('OPENSSH_FOR_WINDOWS_DIRECTORY')
4949
if (openSSHPath != '' and FileExist(openSSHPath . '\sshd.exe')) {
5050
Info('Generate 26M of data')
51-
RunWait('git init --bare -b main large.git', '', 'Hide')
52-
RunWait('git --git-dir=large.git -c alias.c="!(' .
51+
largeFilesDirectory := EnvGet('LARGE_FILES_DIRECTORY')
52+
if largeFilesDirectory == ''
53+
largeFilesDirectory := workTree . '-large-files'
54+
largeGitRepoPath := largeFilesDirectory . '\large.git'
55+
largeGitClonePath := largeFilesDirectory . '\large-clone'
56+
RunWait('git init --bare -b main "' . largeGitRepoPath . '"', '', 'Hide')
57+
RunWait('git --git-dir="' . largeGitRepoPath . '" -c alias.c="!(' .
5358
'printf \"reset refs/heads/main\\n\"; ' .
5459
'seq 100000 | ' .
5560
'sed \"s|.*|blob\\nmark :&\\ndata <<E\\n&\\nE\\ncommit refs/heads/main\\n' .
@@ -112,8 +117,8 @@ if (openSSHPath != '' and FileExist(openSSHPath . '\sshd.exe')) {
112117
;
113118
; The username is needed because by default, on domain-joined machines MSYS2's
114119
; `ssh.exe` prefixes the username with the domain name.
115-
cloneOptions := '--upload-pack="powershell git upload-pack" ' .
116-
EnvGet('USERNAME') . '@localhost:' . workTree . '\large.git large-clone'
120+
cloneOptions := '--upload-pack="powershell git upload-pack" "' .
121+
EnvGet('USERNAME') . '@localhost:' . largeGitRepoPath . '" "' . largeGitClonePath . '"'
117122
Send('git -c core.sshCommand="ssh ' . sshOptions . '" clone ' . cloneOptions . '{Enter}')
118123
Sleep 50
119124
Info('Waiting for clone to start')
@@ -124,7 +129,7 @@ if (openSSHPath != '' and FileExist(openSSHPath . '\sshd.exe')) {
124129
Sleep 150
125130
WaitForRegExInWindowsTerminal('`nfatal: (.*`r?`n){1,3}PS .*>[ `n`r]*$', 'Timed out waiting for clone to be interrupted', 'clone was interrupted as desired')
126131

127-
if DirExist(workTree . '\large-clone')
132+
if DirExist(largeGitClonePath)
128133
ExitWithError('`large-clone` was unexpectedly not deleted on interrupt')
129134
}
130135

0 commit comments

Comments
 (0)