diff options
| -rw-r--r-- | src/Command/Run.hs | 7 | ||||
| -rw-r--r-- | test/asset/run/many_repos.yaml | 1 | ||||
| -rw-r--r-- | test/script/run.et | 17 |
3 files changed, 23 insertions, 2 deletions
diff --git a/src/Command/Run.hs b/src/Command/Run.hs index 7b34757..982a07a 100644 --- a/src/Command/Run.hs +++ b/src/Command/Run.hs @@ -146,7 +146,8 @@ mergeSources sources = do argumentJobSource :: [ JobName ] -> CommandExec JobSource argumentJobSource [] = emptyJobSource argumentJobSource names = do - ( config, jcommit ) <- getJobRoot >>= \case + jobRoot <- getJobRoot + ( config, jcommit ) <- case jobRoot of JobRootConfig config -> do commit <- sequence . fmap createWipCommit =<< tryGetDefaultRepo return ( config, commit ) @@ -158,7 +159,9 @@ argumentJobSource names = do jobtree <- case jcommit of Just commit -> (: []) <$> getCommitTree commit Nothing -> return [] - let cidPart = map (JobIdTree Nothing "" . treeId) jobtree + let cidPart = case jobRoot of + JobRootConfig {} -> [] + JobRootRepo {} -> map (JobIdTree Nothing "" . treeId) jobtree forM_ names $ \name -> case find ((name ==) . jobName) (configJobs config) of Just _ -> return () diff --git a/test/asset/run/many_repos.yaml b/test/asset/run/many_repos.yaml index 9ab87a4..d861433 100644 --- a/test/asset/run/many_repos.yaml +++ b/test/asset/run/many_repos.yaml @@ -54,6 +54,7 @@ job first_manual_revision: job second: checkout: + - dest: main - repo: r2 dest: d2 - repo: r5 diff --git a/test/script/run.et b/test/script/run.et index 95dc2ac..82ad075 100644 --- a/test/script/run.et +++ b/test/script/run.et @@ -483,6 +483,8 @@ test RunWithManyRepos: expect /([0-9a-f]+)/ from git_init capture r5c expect /([0-9a-f]+)/ from git_init capture r5t + # Path to a repo containing the script file + local: spawn on n as p args [ "--storage=minici", "--repo=r1:./dir_r1", "--repo=r3:./dir_r3", "--repo=r4:./dir_r4", "--repo=r2:./dir_r2", "--repo=r5:./dir_r5", "--destination=d1:./dest1", "./main", "run", "--rerun-all", "first" ] expect_success from p of "$mt.first.$r1t.$r2t.$r3t.$r4t" @@ -562,3 +564,18 @@ test RunWithManyRepos: expect_success from p of "$mt.combined_transitive.$r1t.$r2t.$r3t.$r4t.$r5t" expect /(.*)/ from p capture done guard (done == "run-finish") + + + # Explicit path to the script file + + local: + spawn on n as p args [ "--storage=minici", "--repo=r1:./dir_r1", "--repo=r3:./dir_r3", "--repo=r4:./dir_r4", "--repo=r2:./dir_r2", "--repo=r5:./dir_r5", "--destination=d1:./dest1", "./main/minici.yaml", "run", "--rerun-all", "first" ] + expect_success from p of "first.$r1t.$r2t.$r3t.$r4t" + expect /(.*)/ from p capture done + guard (done == "run-finish") + + local: + spawn on n as p args [ "--storage=minici", "--repo=r1:./dir_r1", "--repo=r3:./dir_r3", "--repo=r4:./dir_r4", "--repo=r2:./dir_r2", "--repo=r5:./dir_r5", "--destination=d1:./dest1", "./main/minici.yaml", "run", "--rerun-all", "second" ] + expect_success from p of "second.$mt.$r2t.$r3t.$r5t" + expect /(.*)/ from p capture done + guard (done == "run-finish") |