Skip to content

Commit

Permalink
tools.vpm: skip slow tests, that do need network access, when `-d net…
Browse files Browse the repository at this point in the history
…work` is not provided
  • Loading branch information
spytheman committed Dec 10, 2023
1 parent 08189d6 commit e6bb6df
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/tools/vpm/dependency_test.v
Expand Up @@ -8,6 +8,10 @@ const v = os.quoted_path(@VEXE)
const test_path = os.join_path(os.vtmp_dir(), 'vpm_dependency_test_${rand.ulid()}')

fn testsuite_begin() {
$if !network ? {
eprintln('> skipping ${@FILE}, when `-d network` is missing')
exit(0)
}
os.setenv('VMODULES', test_path, true)
os.setenv('VPM_DEBUG', '', true)
os.setenv('VPM_NO_INCREMENT', '1', true)
Expand Down
4 changes: 4 additions & 0 deletions cmd/tools/vpm/install_test.v
Expand Up @@ -11,6 +11,10 @@ import test_utils
const test_path = os.join_path(os.vtmp_dir(), 'vpm_install_test_${rand.ulid()}')

fn testsuite_begin() {
$if !network ? {
eprintln('> skipping ${@FILE}, when `-d network` is missing')
exit(0)
}
test_utils.set_test_env(test_path)
}

Expand Down
4 changes: 4 additions & 0 deletions cmd/tools/vpm/install_version_input_test.v
Expand Up @@ -13,6 +13,10 @@ const expect_exe = os.quoted_path(os.find_abs_path_of_executable('expect') or {
})

fn testsuite_begin() {
$if !network ? {
eprintln('> skipping ${@FILE}, when `-d network` is missing')
exit(0)
}
test_utils.set_test_env(test_path)
// Explicitly disable fail on prompt.
os.setenv('VPM_FAIL_ON_PROMPT', '', true)
Expand Down
4 changes: 4 additions & 0 deletions cmd/tools/vpm/install_version_test.v
Expand Up @@ -9,6 +9,10 @@ import test_utils
const test_path = os.join_path(os.vtmp_dir(), 'vpm_install_version_test_${rand.ulid()}')

fn testsuite_begin() {
$if !network ? {
eprintln('> skipping ${@FILE}, when `-d network` is missing')
exit(0)
}
test_utils.set_test_env(test_path)
}

Expand Down
4 changes: 4 additions & 0 deletions cmd/tools/vpm/outdated_test.v
Expand Up @@ -8,6 +8,10 @@ import test_utils
const test_path = os.join_path(os.vtmp_dir(), 'vpm_outdated_test_${rand.ulid()}')

fn testsuite_begin() {
$if !network ? {
eprintln('> skipping ${@FILE}, when `-d network` is missing')
exit(0)
}
test_utils.set_test_env(test_path)
os.mkdir_all(test_path)!
os.chdir(test_path)!
Expand Down
4 changes: 4 additions & 0 deletions cmd/tools/vpm/update_test.v
Expand Up @@ -7,6 +7,10 @@ const v = os.quoted_path(@VEXE)
const test_path = os.join_path(os.vtmp_dir(), 'vpm_update_test_${rand.ulid()}')

fn testsuite_begin() {
$if !network ? {
eprintln('> skipping ${@FILE}, when `-d network` is missing')
exit(0)
}
test_utils.set_test_env(test_path)
}

Expand Down

0 comments on commit e6bb6df

Please sign in to comment.