diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..31766ac6 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "corral/test/testdata/corral-test-repo"] + path = corral/test/testdata/corral-test-repo + url = https://github.com/ponylang/corral-test-repo diff --git a/corral/bundle/bundle.pony b/corral/bundle/bundle.pony index eb73a8a7..8f5df276 100644 --- a/corral/bundle/bundle.pony +++ b/corral/bundle/bundle.pony @@ -73,7 +73,7 @@ class Bundle ld.locator = locator ld.revision = revision let dep = Dep(this, dd, ld) - deps(dd.locator) = dep + deps(locator) = dep modified = true dep diff --git a/corral/bundle/dep.pony b/corral/bundle/dep.pony index ec0bd1f1..17552514 100644 --- a/corral/bundle/dep.pony +++ b/corral/bundle/dep.pony @@ -25,9 +25,8 @@ class val Locator is (su.ComparableMixin[Locator] & Hashable & Stringable) rp = parts(0)? vs = s let p = parts(1)? - bp = if (p.size() > 0) and (p(0)? == '/') then p.trim(1) else p end - // TODO: strip any leading scheme:// - //Debug.out(" loc:: rp:" + rp + " vs:" + vs + " bp:" + bp) + bp = if p.at("/") then p.trim(1) else p end + //Debug.out(" loc:: " + loc + " => rp:" + rp + " vs:" + vs + " bp:" + bp) break end end end @@ -59,7 +58,7 @@ class val Locator is (su.ComparableMixin[Locator] & Hashable & Stringable) fun is_vcs(): Bool => vcs_suffix != "" - fun is_local(): Bool => (repo_path == "") and (vcs_suffix == "") + fun is_local(): Bool => (repo_path == "") or repo_path.at(".") or repo_path.at("/") fun is_remote_vcs(): Bool => is_vcs() and not is_local() @@ -83,28 +82,17 @@ class Dep lock = lock' locator = Locator(data.locator) - fun name(): String => - locator.path() + fun name(): String => locator.path() - fun repo(): String => - locator.repo_path + locator.vcs_suffix + fun repo(): String => locator.repo_path + locator.vcs_suffix - fun flat_repo(): String => - _Flattened(repo()) + fun flat_repo(): String => _Flattened(repo()) fun version(): String => data.version - fun revision(): String => - if lock.revision != "" then - lock.revision - elseif data.version != "" then - data.version - else - "master" - end + fun revision(): String => lock.revision - fun vcs(): String => - locator.vcs_suffix.trim(1) + fun vcs(): String => locator.vcs_suffix.trim(1) primitive _Flattened fun apply(path: String): String val => diff --git a/corral/cmd/cmd_fetch.pony b/corral/cmd/cmd_fetch.pony index 95c795c0..c7bb50c3 100644 --- a/corral/cmd/cmd_fetch.pony +++ b/corral/cmd/cmd_fetch.pony @@ -10,7 +10,8 @@ class CmdFetch is CmdType new create(cmd: Command) => None fun apply(ctx: Context, project: Project) => - ctx.uout.info("fetch:") + ctx.uout.info("fetch: fetching from " + project.dir.path) + match project.load_bundle() | let base_bundle: Bundle iso => _Fetcher(ctx, project, consume base_bundle) @@ -52,20 +53,10 @@ actor _Fetcher let vcs = VCSForType(ctx.env, dep.vcs())? let repo = RepoForDep(ctx, project, dep)? - // Determine revision of the dep to fetch - // - If it's already resolved from a lock, use that. - // - Else, if the dep is a specific revision, use that. - // - Else, it is a constraint to solve but update should have done that, - // so just use master for now. - // TODO https://github.com/ponylang/corral/issues/59 - - var revision = base_bundle.dep_revision(dep.locator.string()) - if revision == "" then - revision = dep.revision() - end - if Constraints.parse(revision).size() > 0 then - revision = "master" // TODO: hack until we can ensure revisions are all locked. - end + let revision = Constraints.best_revision( + base_bundle.dep_revision(dep.locator.string()), + dep.revision(), + dep.version()) let self: _Fetcher tag = this let checkout_op = vcs.checkout_op(revision, @@ -80,13 +71,17 @@ actor _Fetcher be fetch_transitive_dep(locator: Locator) => ctx.log.info("Fetching transitive dep: " + locator.path()) + + let bundle_dir = try + project.dep_bundle_root(locator)? + else + ctx.log.err("Unexpected error making path for: " + locator.string()) + return + end try - let bundle_dir = project.dep_bundle_root(locator)? ctx.log.fine("Fetching dep's bundle from: " + bundle_dir.path) let dep_bundle: Bundle val = Bundle.load(bundle_dir, ctx.log)? - ctx.log.fine("Fetched dep's bundle is: " + dep_bundle.name()) fetch_bundle_deps(dep_bundle) else - ctx.uout.err("Error loading/fetching dep bundle: " + locator.flat_name()) - ctx.env.exitcode(1) + ctx.uout.warn("No dep bundle for: " + locator.string()) end diff --git a/corral/cmd/cmd_info.pony b/corral/cmd/cmd_info.pony index 7b4dea8f..306752ef 100644 --- a/corral/cmd/cmd_info.pony +++ b/corral/cmd/cmd_info.pony @@ -8,13 +8,10 @@ class CmdInfo is CmdType new create(cmd: Command) => None fun apply(ctx: Context, project: Project) => - ctx.uout.info("info: from dir " + project.dir.path) + ctx.uout.info("info: from " + project.dir.path) match project.load_bundle() | let bundle: Bundle => - ctx.uout.info( - "info: from " + Files.bundle_filename() - + " in " + bundle.name()) ctx.uout.info("info: " + bundle.info.json().string()) | let err: Error => ctx.uout.err(err.message) diff --git a/corral/cmd/cmd_init.pony b/corral/cmd/cmd_init.pony index b3f2acb6..c9fc93ed 100644 --- a/corral/cmd/cmd_init.pony +++ b/corral/cmd/cmd_init.pony @@ -11,7 +11,7 @@ class CmdInit is CmdType fun requires_no_bundle(): Bool => true fun apply(ctx: Context, project: Project) => - ctx.uout.info("init: from dir " + project.dir.path) + ctx.uout.info("init: in " + project.dir.path) // TODO: try to read first to convert/update existing file(s) // TODO: might want to fail if files exist. diff --git a/corral/cmd/cmd_list.pony b/corral/cmd/cmd_list.pony index fdc3910e..e592581f 100644 --- a/corral/cmd/cmd_list.pony +++ b/corral/cmd/cmd_list.pony @@ -8,13 +8,10 @@ class CmdList is CmdType new create(cmd: Command) => None fun apply(ctx: Context, project: Project) => - ctx.uout.info("list: from dir " + project.dir.path) + ctx.uout.info("list: from " + project.dir.path) match project.load_bundle() | let bundle: Bundle => - ctx.uout.info( - "list: listing " + Files.bundle_filename() + " in " + bundle.name()) - let iter = project.transitive_deps(bundle).values() for d in iter do ctx.uout.info(" dep: " + d.name()) diff --git a/corral/cmd/cmd_update.pony b/corral/cmd/cmd_update.pony index b5991d34..98be09e5 100644 --- a/corral/cmd/cmd_update.pony +++ b/corral/cmd/cmd_update.pony @@ -10,7 +10,7 @@ class CmdUpdate is CmdType new create(cmd: Command) => None fun apply(ctx: Context, project: Project) => - ctx.uout.info("update:") + ctx.uout.info("update: updating from " + project.dir.path) match project.load_bundle() | let bundle: Bundle iso => _Updater(ctx, project, consume bundle) @@ -70,7 +70,12 @@ actor _Updater ctx.log.info("Loading dep: " + locator.path()) - let checkout_op = vcs.checkout_op("master", { + let revision = Constraints.best_revision( + base_bundle.dep_revision(dep.locator.string()), + dep.revision(), + dep.version()) + + let checkout_op = vcs.checkout_op(revision, { (repo: Repo) => self.load_transitive_dep(locator) } val) @@ -88,15 +93,15 @@ actor _Updater sync_op(repo) be load_transitive_dep(locator: Locator) => - ctx.log.info("Fetching transitive dep: " + locator.path()) + ctx.log.info("Loading transitive dep: " + locator.path()) try let bundle_dir = project.dep_bundle_root(locator)? - ctx.log.fine("Fetching dep's bundle from: " + bundle_dir.path) + ctx.log.fine("Loading dep's bundle from: " + bundle_dir.path) let dep_bundle: Bundle ref = Bundle.load(bundle_dir, ctx.log)? - ctx.log.fine("Fetched dep's bundle is: " + dep_bundle.name()) + ctx.log.fine("Loading dep's bundle is: " + dep_bundle.name()) load_bundle_deps(dep_bundle) else - ctx.uout.err("Error loading/fetching dep bundle: " + locator.flat_name()) + ctx.uout.err("Error loading dep bundle: " + locator.flat_name()) ctx.env.exitcode(1) end @@ -134,22 +139,15 @@ actor _Updater end fun ref update_dep(dep: Dep, tags: Array[String] val) => - try - // TODO: consider parsing version much earlier, maybe in Bundle. - // TODO: also consider allowing literal tags and not just constraints - // expressions. - // https://github.com/ponylang/corral/issues/26 - let constraints = Constraints.parse(dep.data.version) - - let result = Constraints.solve(constraints, tags, ctx.log) - - // TODO: probably OK to have multiple solutions: choose 'best' with a strategy like 'latest'. - // https://github.com/ponylang/corral/issues/63 - if result.solution.size() == 1 then - let rev: String = result.solution(0)?.version.string() - ctx.log.fine("solution for " + dep.locator.string() + ": " + rev) - base_bundle.lock_revision(dep.locator.string(), rev) - else - ctx.log.fine("no single solution for " + dep.locator.string() + ": " + result.solution.size().string()) + // TODO: consider parsing version much earlier, maybe in Bundle. + // https://github.com/ponylang/corral/issues/26 + + let revision = + match Constraints.resolve_version(dep.data.version, tags, ctx.log) + | "" => Constraints.best_revision( + base_bundle.dep_revision(dep.locator.string()), + dep.revision(), + dep.version()) + | let rev: String => rev end - end + base_bundle.lock_revision(dep.locator.string(), revision) diff --git a/corral/cmd/constraints.pony b/corral/cmd/constraints.pony index cdd59490..718d6552 100644 --- a/corral/cmd/constraints.pony +++ b/corral/cmd/constraints.pony @@ -5,19 +5,82 @@ use sv="../semver/version" use "../util" primitive Constraints - fun parse(constraint_str: String box): Array[ss.Constraint] => + + fun resolve_version(version: String, tags: Array[String] val, log: Log): String + => + """ + Returns the best revision given a version string and an array of tag + choices. If version is a tag, hash or other non-constraint, then return + that. + """ + // Attempt to parse version as constraints. + let constraints = + try + _parse_constraints(version)? + else + return version // interpret version as a literal tag or hash + end + + let result = _solve_constraints(constraints, tags, log) + + // TODO: probably OK to have multiple solutions: choose 'best' with a strategy like 'latest'. + // https://github.com/ponylang/corral/issues/63 + + try + if (result.solution.size() == 0) or (result.is_err()) then + log.warn("no solution for " + version + ": " + result.err) + "" + elseif result.solution.size() == 1 then + let rev: String = result.solution(0)?.version.string() + log.fine("single solution for " + version + ": " + rev) + rev + else + log.fine("multiple solutions for " + version + ": " + result.solution.size().string()) + let max_heap = MaxHeap[ss.Artifact box](result.solution.size()) + max_heap.append(result.solution) // Could use itertools.map() to get a String iter + let rev_arti = max_heap.pop()? + log.fine(" selected: " + rev_arti.string()) + rev_arti.string() + end + else + "" // Should not happen since we know collections accessed are not empty + end + + + fun best_revision(lrevision: String, drevision: String, version: String): String + => + """ + Returns the best choice of possible: a lock revision, a fallback dep revision, and a version. + TODO https://github.com/ponylang/corral/issues/59 + """ + if lrevision != "" then + lrevision // Base lock revision is always best + elseif drevision != "" then + drevision // Dep lock revision is second best + else + try + Constraints._parse_constraints(version)? + "master" // Is a constraint: use master until update. + else + if version != "" then + version // Version is not a constraint, use that. + else + "master" // Get the latest master if no constraints at all. + end + end + end + + fun _parse_constraints(constraint_str: String box): Array[ss.Constraint] ? => let constraints: Array[ss.Constraint] = constraints.create() for c in constraint_str.split_by(" ").values() do let cs = recover val c.clone().>strip() end if cs != "" then - try - constraints.push(_parse_constraint(cs)?) - else - // How should we report a bad constraint? - None // ctx.log.warn("Error parsing constraint " + cs) - end + constraints.push(_parse_constraint(cs)?) end end + if constraints.size() == 0 then + error + end constraints fun _parse_constraint(c: String box): ss.Constraint ? => @@ -42,16 +105,16 @@ primitive Constraints end error - fun solve(constraints: Array[ss.Constraint], tags: Array[String] val, log: Log): ss.Result + fun _solve_constraints(constraints: Array[ss.Constraint], tags: Array[String] val, log: Log): ss.Result => - let source: ss.InMemArtifactSource = source.create() - for tg in tags.values() do - log.fine(" tag:" + tg) - let artifact = ss.Artifact("A", sv.ParseVersion(tg)) - source.add(artifact) - end - let result = ss.Solver(source).solve(constraints.values()) - if result.is_err() then - log.fine("result err: " + result.err) - end - result + let source: ss.InMemArtifactSource = source.create() + for tg in tags.values() do + log.fine(" tag:" + tg) + let artifact = ss.Artifact("A", sv.ParseVersion(tg)) + source.add(artifact) + end + let result = ss.Solver(source).solve(constraints.values()) + if result.is_err() then + log.fine("result err: " + result.err) + end + result diff --git a/corral/test/integration/test_clean.pony b/corral/test/integration/test_clean.pony index 8a732783..c9c3286d 100644 --- a/corral/test/integration/test_clean.pony +++ b/corral/test/integration/test_clean.pony @@ -4,7 +4,7 @@ use ".." use "../../util" class TestClean is UnitTest - fun name(): String => "integration/clean-github-deep" + fun name(): String => "integration/clean/github-deep" fun apply(h: TestHelper) => h.long_test(2_000_000_000) diff --git a/corral/test/integration/test_fetch.pony b/corral/test/integration/test_fetch.pony index c7d7d693..967a2745 100644 --- a/corral/test/integration/test_fetch.pony +++ b/corral/test/integration/test_fetch.pony @@ -3,8 +3,10 @@ use "ponytest" use ".." use "../../util" +// Local non-VCS + class TestFetchEmpty is UnitTest - fun name(): String => "integration/fetch-empty-deps" + fun name(): String => "integration/fetch/empty-deps" fun apply(h: TestHelper) => h.long_test(2_000_000_000) Execute(h, recover [ @@ -19,16 +21,16 @@ primitive CheckFetchEmpty is Checker h.complete(ar.exit_code == 0) -class TestFetchGithubDeep is UnitTest - fun name(): String => "integration/fetch-github-deep" +class TestFetchLocalDirect is UnitTest + fun name(): String => "integration/fetch/local-direct" fun apply(h: TestHelper) => - h.long_test(5_000_000_000) + h.long_test(2_000_000_000) Execute(h, recover [ "fetch" - "--bundle_dir"; Path.join(TestDir.path, "github-deep") - ] end, CheckFetchGithubDeep) + "--bundle_dir"; Path.join(TestDir.path, "local-direct") + ] end, CheckFetchLocalDirect) -primitive CheckFetchGithubDeep is Checker +primitive CheckFetchLocalDirect is Checker fun tag apply(h: TestHelper, ar: ActionResult) => try h.assert_eq[I32](0, ar.exit_code) @@ -36,31 +38,87 @@ primitive CheckFetchGithubDeep is Checker let auth = h.env.root as AmbientAuth - let repos_dir = TestDir(auth, "github-deep/_repos")? - h.assert_true(repos_dir.join("github_com_cquinn_pony_repo1_git")?.exists()) - h.assert_true(repos_dir.join("github_com_cquinn_pony_repo2_git")?.exists()) + let repos_dir = TestDir(auth, "local-direct/_repos")? + h.assert_false(repos_dir.exists()) repos_dir.remove() - let corral_dir = TestDir(auth, "github-deep/_corral")? - h.assert_true(corral_dir.join("github_com_cquinn_pony_repo1_bundle1/bundle1/corral.json")?.exists()) - h.assert_true(corral_dir.join("github_com_cquinn_pony_repo2_bundle2a/bundle2a/corral.json")?.exists()) - h.assert_true(corral_dir.join("github_com_cquinn_pony_repo2_bundle2b/bundle2b/corral.json")?.exists()) + let corral_dir = TestDir(auth, "local-direct/_corral")? + h.assert_false(corral_dir.exists()) corral_dir.remove() h.complete(ar.exit_code == 0) end -class TestFetchRemoteGits is UnitTest - fun name(): String => "integration/fetch-remote-gits" +class TestFetchMutuallyRecursive is UnitTest + fun name(): String => "integration/fetch/mutually-recursive" + fun apply(h: TestHelper) => + h.long_test(2_000_000_000) + Execute(h, recover [ + "fetch" + "--bundle_dir"; Path.join(TestDir.path, "mutually-recursive") + ] end, CheckFetchMutuallyRecursive) + +primitive CheckFetchMutuallyRecursive is Checker + fun tag apply(h: TestHelper, ar: ActionResult) => + try + h.assert_eq[I32](0, ar.exit_code) + h.assert_true(ar.stdout.contains("fetch:")) + + let auth = h.env.root as AmbientAuth + + let repos_dir = TestDir(auth, "mutually-recursive/_repos")? + h.assert_false(repos_dir.exists()) + repos_dir.remove() + + let corral_dir = TestDir(auth, "mutually-recursive/_corral")? + h.assert_false(corral_dir.exists()) + corral_dir.remove() + + h.complete(ar.exit_code == 0) + end + + +class TestFetchSelfReferential is UnitTest + fun name(): String => "integration/fetch/self-referential" + fun apply(h: TestHelper) => + h.long_test(2_000_000_000) + Execute(h, recover [ + "fetch" + "--bundle_dir"; Path.join(TestDir.path, "self-referential") + ] end, CheckFetchSelfReferential) + +primitive CheckFetchSelfReferential is Checker + fun tag apply(h: TestHelper, ar: ActionResult) => + try + h.assert_eq[I32](0, ar.exit_code) + h.assert_true(ar.stdout.contains("fetch:")) + + let auth = h.env.root as AmbientAuth + + let repos_dir = TestDir(auth, "self-referential/_repos")? + h.assert_false(repos_dir.exists()) + repos_dir.remove() + + let corral_dir = TestDir(auth, "self-referential/_corral")? + h.assert_false(corral_dir.exists()) + corral_dir.remove() + + h.complete(ar.exit_code == 0) + end + +// Local VCS + +class TestFetchLocalGits is UnitTest + fun name(): String => "integration/fetch/local-git" fun apply(h: TestHelper) => h.long_test(10_000_000_000) Execute(h, recover [ "fetch" - "--bundle_dir"; Path.join(TestDir.path, "remote-gits") - ] end, CheckFetchRemoteGits) + "--bundle_dir"; Path.join(TestDir.path, "local-git") + ] end, CheckFetchLocalGits) -primitive CheckFetchRemoteGits is Checker +primitive CheckFetchLocalGits is Checker fun tag apply(h: TestHelper, ar: ActionResult) => try h.assert_eq[I32](0, ar.exit_code) @@ -68,13 +126,13 @@ primitive CheckFetchRemoteGits is Checker let auth = h.env.root as AmbientAuth - let repos_dir = TestDir(auth, "remote-gits/_repos")? + let repos_dir = TestDir(auth, "local-gits/_repos")? h.assert_true(repos_dir.join("bitbucket_org_cquinn_pony_thing_git")?.exists()) h.assert_true(repos_dir.join("github_com_cquinn_pony_repo2_git")?.exists()) h.assert_true(repos_dir.join("gitlab_com_cquinn1_justatest_git")?.exists()) repos_dir.remove() - let corral_dir = TestDir(auth, "remote-gits/_corral")? + let corral_dir = TestDir(auth, "local-gits/_corral")? h.assert_true(corral_dir.join("bitbucket_org_cquinn_pony_thing/corral.json")?.exists()) h.assert_true(corral_dir.join("github_com_cquinn_pony_repo2_bundle2b/bundle2b/corral.json")?.exists()) h.assert_true(corral_dir.join("gitlab_com_cquinn1_justatest/corral.json")?.exists()) @@ -83,17 +141,18 @@ primitive CheckFetchRemoteGits is Checker h.complete(ar.exit_code == 0) end +// Remote VCS -class TestFetchLocalDirect is UnitTest - fun name(): String => "integration/fetch-local-direct" +class TestFetchGithubDeep is UnitTest + fun name(): String => "integration/fetch/github-deep" fun apply(h: TestHelper) => - h.long_test(2_000_000_000) + h.long_test(5_000_000_000) Execute(h, recover [ "fetch" - "--bundle_dir"; Path.join(TestDir.path, "local-direct") - ] end, CheckFetchLocalDirect) + "--bundle_dir"; Path.join(TestDir.path, "github-deep") + ] end, CheckFetchGithubDeep) -primitive CheckFetchLocalDirect is Checker +primitive CheckFetchGithubDeep is Checker fun tag apply(h: TestHelper, ar: ActionResult) => try h.assert_eq[I32](0, ar.exit_code) @@ -101,9 +160,46 @@ primitive CheckFetchLocalDirect is Checker let auth = h.env.root as AmbientAuth - let corral_dir = TestDir(auth, "local-direct/_corral")? + let repos_dir = TestDir(auth, "github-deep/_repos")? + h.assert_true(repos_dir.join("github_com_ponylang_corral_test_repo_git")?.exists()) + repos_dir.remove() + + let corral_dir = TestDir(auth, "github-deep/_corral")? + h.assert_true(corral_dir.join("github_com_ponylang_corral_test_repo_bundle1/bundle1/corral.json")?.exists()) + h.assert_true(corral_dir.join("github_com_ponylang_corral_test_repo_bundle2/bundle2/corral.json")?.exists()) + h.assert_true(corral_dir.join("github_com_ponylang_corral_test_repo_bundle3/bundle3/corral.json")?.exists()) + corral_dir.remove() + + h.complete(ar.exit_code == 0) + end + + +class TestFetchRemoteGits is UnitTest + fun name(): String => "integration/fetch/remote-gits" + fun apply(h: TestHelper) => + h.long_test(10_000_000_000) + Execute(h, recover [ + "fetch" + "--bundle_dir"; Path.join(TestDir.path, "remote-gits") + ] end, CheckFetchRemoteGits) + +primitive CheckFetchRemoteGits is Checker + fun tag apply(h: TestHelper, ar: ActionResult) => + try + h.assert_eq[I32](0, ar.exit_code) + h.assert_true(ar.stdout.contains("fetch:")) + + let auth = h.env.root as AmbientAuth + + let repos_dir = TestDir(auth, "remote-gits/_repos")? + h.assert_true(repos_dir.join("bitbucket_org_cquinn_pony_thing_git")?.exists()) + h.assert_true(repos_dir.join("github_com_ponylang_corral_test_repo_git")?.exists()) + h.assert_true(repos_dir.join("gitlab_com_cquinn1_justatest_git")?.exists()) + repos_dir.remove() + + let corral_dir = TestDir(auth, "remote-gits/_corral")? h.assert_true(corral_dir.join("bitbucket_org_cquinn_pony_thing/corral.json")?.exists()) - h.assert_true(corral_dir.join("github_com_cquinn_pony_repo2_bundle2b/bundle2b/corral.json")?.exists()) + h.assert_true(corral_dir.join("github_com_ponylang_corral_test_repo_bundle3/bundle3/corral.json")?.exists()) h.assert_true(corral_dir.join("gitlab_com_cquinn1_justatest/corral.json")?.exists()) corral_dir.remove() diff --git a/corral/test/integration/test_info.pony b/corral/test/integration/test_info.pony index f41ea9af..bc551238 100644 --- a/corral/test/integration/test_info.pony +++ b/corral/test/integration/test_info.pony @@ -19,7 +19,7 @@ class CheckInfo is Checker h.complete(ar.exit_code == 0) class TestInfoWithoutBundle is UnitTest - fun name(): String => "integration/info-without-bundle" + fun name(): String => "integration/info/without-bundle" fun apply(h: TestHelper) => h.long_test(2_000_000_000) Execute(h, recover [ diff --git a/corral/test/integration/test_run.pony b/corral/test/integration/test_run.pony index 75e216bd..727bd9fc 100644 --- a/corral/test/integration/test_run.pony +++ b/corral/test/integration/test_run.pony @@ -21,7 +21,7 @@ class CheckRun is Checker h.complete(ar.exit_code == 0) class TestRunWithoutBundle is UnitTest - fun name(): String => "integration/run-without-bundle" + fun name(): String => "integration/run/without-bundle" fun apply(h: TestHelper) => h.long_test(2_000_000_000) Execute(h, recover [ diff --git a/corral/test/integration/test_update.pony b/corral/test/integration/test_update.pony index 3a7b8451..b1209ee8 100644 --- a/corral/test/integration/test_update.pony +++ b/corral/test/integration/test_update.pony @@ -4,7 +4,7 @@ use ".." use "../../util" class TestUpdateEmpty is UnitTest - fun name(): String => "integration/update-empty-deps" + fun name(): String => "integration/update/empty-deps" fun apply(h: TestHelper) => h.long_test(2_000_000_000) Execute(h, recover [ @@ -19,7 +19,7 @@ class CheckUpdateEmpty is Checker h.complete(ar.exit_code == 0) class TestUpdateGithub is UnitTest - fun name(): String => "integration/update-github-leaf" + fun name(): String => "integration/update/github-leaf" fun apply(h: TestHelper) => h.long_test(2_000_000_000) Execute(h, recover [ diff --git a/corral/test/testdata/abitofeverything/corral.json b/corral/test/testdata/abitofeverything/corral.json index f58d7dc7..ea73ec3e 100644 --- a/corral/test/testdata/abitofeverything/corral.json +++ b/corral/test/testdata/abitofeverything/corral.json @@ -1,6 +1,15 @@ -{"deps":[ - { - "locator": "github.com/cquinn/pony-repo1.git/bundle1", - "version": ">0.11.0 <1.0.0" - } -]} +{ + "deps": [ + { + "locator": "github.com/ponylang/corral-test-repo.git/bundle3", + "version": ">0.11.0 <1.0.0" + }, + { + "locator": "../corral-test-repo.git/bundle3", + "version": ">0.11.0 <1.0.0" + }, + { + "locator": "../empty-deps" + } + ] +} \ No newline at end of file diff --git a/corral/test/testdata/abitofeverything/lock.json b/corral/test/testdata/abitofeverything/lock.json new file mode 100644 index 00000000..944de670 --- /dev/null +++ b/corral/test/testdata/abitofeverything/lock.json @@ -0,0 +1,3 @@ +{ + "locks": [] +} diff --git a/corral/test/testdata/corral-test-repo b/corral/test/testdata/corral-test-repo new file mode 160000 index 00000000..dda8aa38 --- /dev/null +++ b/corral/test/testdata/corral-test-repo @@ -0,0 +1 @@ +Subproject commit dda8aa3887bb2107a822d21e8d77f57c08ea60a7 diff --git a/corral/test/testdata/github-deep/corral.json b/corral/test/testdata/github-deep/corral.json index f469d85e..23924a62 100644 --- a/corral/test/testdata/github-deep/corral.json +++ b/corral/test/testdata/github-deep/corral.json @@ -1,9 +1,9 @@ { "deps": [ { - "locator": "github.com/cquinn/pony-repo1.git/bundle1", + "locator": "github.com/ponylang/corral-test-repo.git/bundle1", "version": ">0.11.0 <1.0.0" } ], "info": {} -} +} \ No newline at end of file diff --git a/corral/test/testdata/github-leaf/corral.json b/corral/test/testdata/github-leaf/corral.json index 4224065f..ff9f7c2f 100644 --- a/corral/test/testdata/github-leaf/corral.json +++ b/corral/test/testdata/github-leaf/corral.json @@ -1,6 +1,8 @@ -{"deps":[ +{ + "deps": [ { - "locator": "github.com/cquinn/pony-repo2.git/bundle2b", + "locator": "github.com/ponylang/corral-test-repo.git/bundle3", "version": ">0.11.0 <1.0.0" } -]} + ] +} \ No newline at end of file diff --git a/corral/test/testdata/local-direct/corral.json b/corral/test/testdata/local-direct/corral.json index 063fc4d5..ce85b664 100644 --- a/corral/test/testdata/local-direct/corral.json +++ b/corral/test/testdata/local-direct/corral.json @@ -1,8 +1,7 @@ { "deps": [ { - "locator": "../empty-deps", - "versionX": ">0.1.0 <1.0.0" + "locator": "../empty-deps" } ] } \ No newline at end of file diff --git a/corral/test/testdata/local-git/corral.json b/corral/test/testdata/local-git/corral.json index a758f3a7..30bd96b4 100644 --- a/corral/test/testdata/local-git/corral.json +++ b/corral/test/testdata/local-git/corral.json @@ -1,7 +1,7 @@ { "deps": [ { - "locator": "/Users/carl/ws/pony/cquinn/rfcs.git", + "locator": "../corral-test-repo.git/bundle3", "version": ">0.11.0 <1.0.0" } ] diff --git a/corral/test/testdata/nested/corral.json b/corral/test/testdata/nested/corral.json deleted file mode 100644 index 8f8a6762..00000000 --- a/corral/test/testdata/nested/corral.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "deps": [] -} \ No newline at end of file diff --git a/corral/test/testdata/nested/deeply/corral.json b/corral/test/testdata/nested/deeply/corral.json deleted file mode 100644 index 8f8a6762..00000000 --- a/corral/test/testdata/nested/deeply/corral.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "deps": [] -} \ No newline at end of file diff --git a/corral/test/testdata/nested/empty/.gitkeep b/corral/test/testdata/nested/empty/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/corral/test/testdata/readme/corral.json b/corral/test/testdata/readme/corral.json new file mode 100644 index 00000000..89b9c8e5 --- /dev/null +++ b/corral/test/testdata/readme/corral.json @@ -0,0 +1,8 @@ +{ + "deps": [ + { + "locator": "github.com/jemc/pony-inspect.git" + } + ], + "info": {} +} diff --git a/corral/test/testdata/readme/lock.json b/corral/test/testdata/readme/lock.json new file mode 100644 index 00000000..beb9faad --- /dev/null +++ b/corral/test/testdata/readme/lock.json @@ -0,0 +1,8 @@ +{ + "locks": [ + { + "locator": "github.com/jemc/pony-inspect.git", + "revision": "master" + } + ] +} diff --git a/corral/test/testdata/readme/main.pony b/corral/test/testdata/readme/main.pony new file mode 100644 index 00000000..2112db96 --- /dev/null +++ b/corral/test/testdata/readme/main.pony @@ -0,0 +1,6 @@ + +use "inspect" +actor Main + new create(env: Env) => + env.out.print(Inspect("Hello, World!")) + diff --git a/corral/test/testdata/remote-gits/corral.json b/corral/test/testdata/remote-gits/corral.json index 62466cb4..6f8ba671 100644 --- a/corral/test/testdata/remote-gits/corral.json +++ b/corral/test/testdata/remote-gits/corral.json @@ -1,7 +1,7 @@ { "deps": [ { - "locator": "github.com/cquinn/pony-repo2.git/bundle2b", + "locator": "github.com/ponylang/corral-test-repo.git/bundle3", "version": ">0.11.0 <1.0.0" }, {