tools.vpm: skip slow tests, that do need network access, when -d network is not provided

This commit is contained in:
Delyan Angelov 2023-12-10 12:14:56 +02:00
parent 08189d649c
commit e6bb6df591
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
6 changed files with 24 additions and 0 deletions

View File

@ -8,6 +8,10 @@ const v = os.quoted_path(@VEXE)
const test_path = os.join_path(os.vtmp_dir(), 'vpm_dependency_test_${rand.ulid()}') const test_path = os.join_path(os.vtmp_dir(), 'vpm_dependency_test_${rand.ulid()}')
fn testsuite_begin() { fn testsuite_begin() {
$if !network ? {
eprintln('> skipping ${@FILE}, when `-d network` is missing')
exit(0)
}
os.setenv('VMODULES', test_path, true) os.setenv('VMODULES', test_path, true)
os.setenv('VPM_DEBUG', '', true) os.setenv('VPM_DEBUG', '', true)
os.setenv('VPM_NO_INCREMENT', '1', true) os.setenv('VPM_NO_INCREMENT', '1', true)

View File

@ -11,6 +11,10 @@ import test_utils
const test_path = os.join_path(os.vtmp_dir(), 'vpm_install_test_${rand.ulid()}') const test_path = os.join_path(os.vtmp_dir(), 'vpm_install_test_${rand.ulid()}')
fn testsuite_begin() { fn testsuite_begin() {
$if !network ? {
eprintln('> skipping ${@FILE}, when `-d network` is missing')
exit(0)
}
test_utils.set_test_env(test_path) test_utils.set_test_env(test_path)
} }

View File

@ -13,6 +13,10 @@ const expect_exe = os.quoted_path(os.find_abs_path_of_executable('expect') or {
}) })
fn testsuite_begin() { fn testsuite_begin() {
$if !network ? {
eprintln('> skipping ${@FILE}, when `-d network` is missing')
exit(0)
}
test_utils.set_test_env(test_path) test_utils.set_test_env(test_path)
// Explicitly disable fail on prompt. // Explicitly disable fail on prompt.
os.setenv('VPM_FAIL_ON_PROMPT', '', true) os.setenv('VPM_FAIL_ON_PROMPT', '', true)

View File

@ -9,6 +9,10 @@ import test_utils
const test_path = os.join_path(os.vtmp_dir(), 'vpm_install_version_test_${rand.ulid()}') const test_path = os.join_path(os.vtmp_dir(), 'vpm_install_version_test_${rand.ulid()}')
fn testsuite_begin() { fn testsuite_begin() {
$if !network ? {
eprintln('> skipping ${@FILE}, when `-d network` is missing')
exit(0)
}
test_utils.set_test_env(test_path) test_utils.set_test_env(test_path)
} }

View File

@ -8,6 +8,10 @@ import test_utils
const test_path = os.join_path(os.vtmp_dir(), 'vpm_outdated_test_${rand.ulid()}') const test_path = os.join_path(os.vtmp_dir(), 'vpm_outdated_test_${rand.ulid()}')
fn testsuite_begin() { fn testsuite_begin() {
$if !network ? {
eprintln('> skipping ${@FILE}, when `-d network` is missing')
exit(0)
}
test_utils.set_test_env(test_path) test_utils.set_test_env(test_path)
os.mkdir_all(test_path)! os.mkdir_all(test_path)!
os.chdir(test_path)! os.chdir(test_path)!

View File

@ -7,6 +7,10 @@ const v = os.quoted_path(@VEXE)
const test_path = os.join_path(os.vtmp_dir(), 'vpm_update_test_${rand.ulid()}') const test_path = os.join_path(os.vtmp_dir(), 'vpm_update_test_${rand.ulid()}')
fn testsuite_begin() { fn testsuite_begin() {
$if !network ? {
eprintln('> skipping ${@FILE}, when `-d network` is missing')
exit(0)
}
test_utils.set_test_env(test_path) test_utils.set_test_env(test_path)
} }