Skip to content

Commit f172a04

Browse files
authored
ci: improve test robustness on windows (#21116)
1 parent f1fba25 commit f172a04

19 files changed

+21
-23
lines changed

cmd/tools/vpm/settings.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ fn init_settings() VpmSettings {
3838
server_urls: cmdline.options(args, '--server-urls')
3939
vcs: if '--hg' in opts { .hg } else { .git }
4040
vmodules_path: os.vmodules_dir()
41-
tmp_path: os.join_path(os.vtmp_dir(), 'vpm', 'modules')
41+
tmp_path: os.join_path(os.vtmp_dir(), 'vpm_modules')
4242
no_dl_count_increment: os.getenv('CI') != '' || (no_inc_env != '' && no_inc_env != '0')
4343
fail_on_prompt: os.getenv('VPM_FAIL_ON_PROMPT') != ''
4444
}

vlib/io/util/util_test.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import io.util
44
// tfolder will contain all the temporary files/subfolders made by
55
// the different tests. It would be removed in testsuite_end(), so
66
// individual os tests do not need to clean up after themselves.
7-
const tfolder = os.join_path(os.vtmp_dir(), 'tests', 'io_util_test')
7+
const tfolder = os.join_path(os.vtmp_dir(), 'io_util_tests')
88

99
fn testsuite_begin() {
1010
eprintln('testsuite_begin, tfolder = ${tfolder}')

vlib/os/file_buffering_test.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import os
22

3-
const tfolder = os.join_path(os.vtmp_dir(), 'tests', 'os_file_buffering_test')
3+
const tfolder = os.join_path(os.vtmp_dir(), 'os_file_buffering_tests')
44

55
fn testsuite_begin() {
66
os.rmdir_all(tfolder) or {}

vlib/os/file_test.v

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import os
22

3-
const tfolder = os.join_path(os.vtmp_dir(), 'tests', 'os_file_test')
3+
const tfolder = os.join_path(os.vtmp_dir(), 'os_file_tests')
44
const tfile = os.join_path_single(tfolder, 'test_file')
55

66
fn testsuite_begin() {
7-
os.rmdir_all(tfolder) or {}
8-
assert !os.is_dir(tfolder)
9-
os.mkdir_all(tfolder)!
7+
os.mkdir_all(tfolder) or {}
108
os.chdir(tfolder)!
119
assert os.is_dir(tfolder)
1210
}

vlib/os/find_abs_path_of_executable_test.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22

33
fn test_find_abs_path_of_executable() {
4-
tfolder := os.join_path(os.vtmp_dir(), 'tests', 'filepath_test')
4+
tfolder := os.join_path(os.vtmp_dir(), 'filepath_tests')
55
os.rmdir_all(tfolder) or {}
66
assert !os.is_dir(tfolder)
77
os.mkdir_all(tfolder)!

vlib/os/inode_test.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import os
33
// tfolder will contain all the temporary files/subfolders made by
44
// the different tests. It would be removed in testsuite_end(), so
55
// individual os tests do not need to clean up after themselves.
6-
const tfolder = os.join_path(os.vtmp_dir(), 'tests', 'inode_test')
6+
const tfolder = os.join_path(os.vtmp_dir(), 'inode_tests')
77

88
fn testsuite_begin() {
99
eprintln('testsuite_begin, tfolder = ${tfolder}')

vlib/os/os_test.c.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import time
44
// tfolder will contain all the temporary files/subfolders made by
55
// the different tests. It would be removed in testsuite_end(), so
66
// individual os tests do not need to clean up after themselves.
7-
const tfolder = os.join_path(os.vtmp_dir(), 'tests', 'os_test')
7+
const tfolder = os.join_path(os.vtmp_dir(), 'os_tests')
88

99
// os.args has to be *already initialized* with the program's argc/argv at this point
1010
// thus it can be used for other consts too:

vlib/os/process_test.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import time
55

66
const vexe = os.getenv('VEXE')
77
const vroot = os.dir(vexe)
8-
const tfolder = os.join_path(os.vtmp_dir(), 'tests', 'os_process')
8+
const tfolder = os.join_path(os.vtmp_dir(), 'os_process_tests')
99
const test_os_process = os.join_path(tfolder, 'test_os_process.exe')
1010
const test_os_process_source = os.join_path(vroot, 'cmd/tools/test_os_process.v')
1111

vlib/toml/tests/alexcrichton_toml_rs_test.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const use_type_2_arrays = [
3636
]
3737
const tests_folder = os.join_path('test-suite', 'tests')
3838
const jq = os.find_abs_path_of_executable('jq') or { '' }
39-
const compare_work_dir_root = os.join_path(os.vtmp_dir(), 'toml', 'alexcrichton')
39+
const compare_work_dir_root = os.join_path(os.vtmp_dir(), 'toml_alexcrichton')
4040
// From: https://stackoverflow.com/a/38266731/1904615
4141
const jq_normalize = r'# Apply f to composite entities recursively using keys[], and to atoms
4242
def sorted_walk(f):

vlib/toml/tests/burntsushi_toml_test.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const valid_value_exceptions = []string{}
2828
//'integer/long.toml', // TODO: https://github.com/vlang/v/issues/9507
2929

3030
const jq = os.find_abs_path_of_executable('jq') or { '' }
31-
const compare_work_dir_root = os.join_path(os.vtmp_dir(), 'toml', 'burntsushi')
31+
const compare_work_dir_root = os.join_path(os.vtmp_dir(), 'toml_burntsushi')
3232
// From: https://stackoverflow.com/a/38266731/1904615
3333
const jq_normalize = r'# Apply f to composite entities recursively using keys[], and to atoms
3434
def sorted_walk(f):

0 commit comments

Comments
 (0)