New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
tools.vpm: add manifest fetch for hg repositories, add test #20107
Conversation
@@ -106,6 +106,9 @@ fn get_mod_vpm_info(name string) !ModuleVpmInfo { | |||
fn get_ident_from_url(raw_url string) !(string, string) { | |||
url := urllib.parse(raw_url) or { return error('failed to parse module URL `${raw_url}`.') } | |||
publisher, mut name := url.path.trim_left('/').rsplit_once('/') or { | |||
if settings.vcs == .hg && raw_url.count(':') > 1 { | |||
return '', 'test_module' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anything would be fine here. This just makes sure a name is returned when a localhost address is fetched during tests that doesn't contain a path after the domain. The eventual module name is derived from the manifest.
27e71e2
to
28d5474
Compare
@@ -166,15 +167,14 @@ fn test_install_potentially_conflicting() { | |||
|
|||
fn test_get_installed_version() { | |||
test_project_path := os.join_path(test_path, 'test_project') | |||
os.mkdir_all(test_project_path)! | |||
mut res := os.execute('git init ${test_project_path}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice ... I did not know, that git init folder
will create it.
import net | ||
import time | ||
|
||
fn hg_serve(hg_path string, path string) (&os.Process, int) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, this should have needed pub
. I am not sure, why it did not fail to compile... Perhaps because it is used in a test file?
import time | ||
|
||
fn hg_serve(hg_path string, path string) (&os.Process, int) { | ||
mut port := 8000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Start probing from some more obscure port. 8000 and 8080 are very likely to be taken by other tests, between the time you check, and the time the mercurial server starts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work.
The PR resolves a todo by fetching and checking the manifest for mercurial repos before installation and adds a first test for projects using mercurial.
mercurial only needs installation on mac runners. It's a default for Ubuntu and Windows runners: https://github.com/actions/runner-images
馃[deprecated] Generated by Copilot at 27e71e2
Improved the
vpm
tool's support for installing V modules from Mercurial repositories. Added tests, refactored code, and fixed parsing errors for Mercurial URLs. Modified the macOS CI workflow to installmercurial
as a dependency. Added atest_utils
module with a helper function for running a local Mercurial server.馃[deprecated] Generated by Copilot at 27e71e2
parse.v
(link)get_manifest_from_resp
function inparse.v
(link)test_utils/utils.v
(link)git init
command ininstall_test.v
(link)v.mod
file fails ininstall_test.v
,install_version_input_test.v
, andinstall_version_test.v
(link, link, link)mercurial
as a dependency for macOS CI tests in.github/workflows/macos_ci.yml
(link)