Skip to content

Commit 0b54759

Browse files
committed
ci: use a different starting port for the hg server web server processes in the different tests, to minimise the chances of conflicts
1 parent 226e1d6 commit 0b54759

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎cmd/tools/vpm/install_test.v‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ fn test_install_from_hg_url() ! {
183183
os.write_file(os.join_path(test_module_path, '.hg/hgrc'), '[ui]\nusername = v_ci <v_ci@example.net>\nverbose = False\n')!
184184
println('> writing .hg/hgrc done.')
185185

186-
mut p, mut port := test_utils.hg_serve(hg_path, test_module_path)
186+
mut p, mut port := test_utils.hg_serve(hg_path, test_module_path, 2000)
187187
// Trying to install it should fail.
188188
res = os.execute('${vexe} install --hg http://127.0.0.1:${port}')
189189
p.signal_kill()
@@ -198,7 +198,7 @@ fn test_install_from_hg_url() ! {
198198
os.chdir(test_module_path)!
199199
cmd_ok(@LOCATION, 'hg add')
200200
cmd_ok(@LOCATION, 'hg commit -m "add v.mod"')
201-
p, port = test_utils.hg_serve(hg_path, test_module_path)
201+
p, port = test_utils.hg_serve(hg_path, test_module_path, 3000)
202202
// Trying to install the module should work now.
203203
res = cmd_ok(@LOCATION, '${vexe} install --hg http://127.0.0.1:${port}')
204204
p.signal_kill()

‎cmd/tools/vpm/install_version_test.v‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ fn test_install_from_hg_url_with_version_tag() ! {
148148
cmd_ok(@LOCATION, 'hg add')
149149
cmd_ok(@LOCATION, 'hg commit -m "bump version to v0.2.0"')
150150

151-
mut p, port := test_utils.hg_serve(hg_path, test_module_path)
151+
mut p, port := test_utils.hg_serve(hg_path, test_module_path, 4000)
152152
res = os.execute('${vexe} install -v --hg http://127.0.0.1:${port}@v0.1.0')
153153
p.signal_kill()
154154
if res.exit_code != 0 {

‎cmd/tools/vpm/test_utils/utils.v‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ pub fn set_test_env(test_path string) {
1212
unbuffer_stdout()
1313
}
1414

15-
pub fn hg_serve(hg_path string, path string) (&os.Process, int) {
16-
mut port := 8000
15+
pub fn hg_serve(hg_path string, path string, start_port int) (&os.Process, int) {
16+
mut port := start_port
1717
for {
1818
if mut l := net.listen_tcp(.ip6, ':${port}') {
1919
l.close() or { panic(err) }

0 commit comments

Comments
 (0)