mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
ci: use a different starting port for the hg server web server processes in the different tests, to minimise the chances of conflicts
This commit is contained in:
parent
226e1d6442
commit
0b547598f5
3 changed files with 5 additions and 5 deletions
|
@ -183,7 +183,7 @@ fn test_install_from_hg_url() ! {
|
||||||
os.write_file(os.join_path(test_module_path, '.hg/hgrc'), '[ui]\nusername = v_ci <v_ci@example.net>\nverbose = False\n')!
|
os.write_file(os.join_path(test_module_path, '.hg/hgrc'), '[ui]\nusername = v_ci <v_ci@example.net>\nverbose = False\n')!
|
||||||
println('> writing .hg/hgrc done.')
|
println('> writing .hg/hgrc done.')
|
||||||
|
|
||||||
mut p, mut port := test_utils.hg_serve(hg_path, test_module_path)
|
mut p, mut port := test_utils.hg_serve(hg_path, test_module_path, 2000)
|
||||||
// Trying to install it should fail.
|
// Trying to install it should fail.
|
||||||
res = os.execute('${vexe} install --hg http://127.0.0.1:${port}')
|
res = os.execute('${vexe} install --hg http://127.0.0.1:${port}')
|
||||||
p.signal_kill()
|
p.signal_kill()
|
||||||
|
@ -198,7 +198,7 @@ fn test_install_from_hg_url() ! {
|
||||||
os.chdir(test_module_path)!
|
os.chdir(test_module_path)!
|
||||||
cmd_ok(@LOCATION, 'hg add')
|
cmd_ok(@LOCATION, 'hg add')
|
||||||
cmd_ok(@LOCATION, 'hg commit -m "add v.mod"')
|
cmd_ok(@LOCATION, 'hg commit -m "add v.mod"')
|
||||||
p, port = test_utils.hg_serve(hg_path, test_module_path)
|
p, port = test_utils.hg_serve(hg_path, test_module_path, 3000)
|
||||||
// Trying to install the module should work now.
|
// Trying to install the module should work now.
|
||||||
res = cmd_ok(@LOCATION, '${vexe} install --hg http://127.0.0.1:${port}')
|
res = cmd_ok(@LOCATION, '${vexe} install --hg http://127.0.0.1:${port}')
|
||||||
p.signal_kill()
|
p.signal_kill()
|
||||||
|
|
|
@ -148,7 +148,7 @@ fn test_install_from_hg_url_with_version_tag() ! {
|
||||||
cmd_ok(@LOCATION, 'hg add')
|
cmd_ok(@LOCATION, 'hg add')
|
||||||
cmd_ok(@LOCATION, 'hg commit -m "bump version to v0.2.0"')
|
cmd_ok(@LOCATION, 'hg commit -m "bump version to v0.2.0"')
|
||||||
|
|
||||||
mut p, port := test_utils.hg_serve(hg_path, test_module_path)
|
mut p, port := test_utils.hg_serve(hg_path, test_module_path, 4000)
|
||||||
res = os.execute('${vexe} install -v --hg http://127.0.0.1:${port}@v0.1.0')
|
res = os.execute('${vexe} install -v --hg http://127.0.0.1:${port}@v0.1.0')
|
||||||
p.signal_kill()
|
p.signal_kill()
|
||||||
if res.exit_code != 0 {
|
if res.exit_code != 0 {
|
||||||
|
|
|
@ -12,8 +12,8 @@ pub fn set_test_env(test_path string) {
|
||||||
unbuffer_stdout()
|
unbuffer_stdout()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn hg_serve(hg_path string, path string) (&os.Process, int) {
|
pub fn hg_serve(hg_path string, path string, start_port int) (&os.Process, int) {
|
||||||
mut port := 8000
|
mut port := start_port
|
||||||
for {
|
for {
|
||||||
if mut l := net.listen_tcp(.ip6, ':${port}') {
|
if mut l := net.listen_tcp(.ip6, ':${port}') {
|
||||||
l.close() or { panic(err) }
|
l.close() or { panic(err) }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue