A peer-to-peer stack for code collaboration
rad-project: Wrong import fails 'rad project checkout'
Thomas Scholtes7811125ea258
diff --git a/bin/rad-project b/bin/rad-projectindex 3b7608f..c576a02 100755--- a/bin/rad-project+++ b/bin/rad-project@@ -17,7 +17,7 @@(import monadic/issue '[create-issue-machine!] :unqualified)(import monadic/project- '[get-project-url! get-meta create-project! add-rsm! first-rsm-of-type!]+ '[get-project-url! get-meta! create-project! add-rsm! first-rsm-of-type!]:unqualified)(def helpdiff --git a/package.yaml b/package.yamlindex 5e172cd..4887942 100644--- a/package.yaml+++ b/package.yaml@@ -125,6 +125,7 @@ tests:- tasty-hunit- temporary- text+ - unliftioexecutables:rad:diff --git a/test/e2e/PatchAppTest.hs b/test/e2e/PatchAppTest.hsindex f3aa689..95b8a72 100644--- a/test/e2e/PatchAppTest.hs+++ b/test/e2e/PatchAppTest.hs@@ -9,10 +9,8 @@ import Test.E2ESupporttest_patch_propose :: TestTreetest_patch_propose = testCaseSteps "patch propose" $ \step -> do+ prepareRadiclestep "Init project"- _ <- runTestCommand "rad-key" ["create"]- _ <- runTestCommand "git" ["config", "--global", "user.name", "Alice"]- _ <- runTestCommand "git" ["config", "--global", "user.email", "[email protected]"]_ <- runTestCommand' "rad-project" ["init"] ["project-name", "project desc", "1"]_ <- runTestCommand "git" ["checkout", "-b", "f/test"]_ <- runTestCommand "touch" ["test"]diff --git a/test/e2e/ProjectAppTest.hs b/test/e2e/ProjectAppTest.hsindex 81bc2a5..370a51b 100644--- a/test/e2e/ProjectAppTest.hs+++ b/test/e2e/ProjectAppTest.hs@@ -1,17 +1,32 @@module ProjectAppTest( test_project_show_id+ , test_project_checkout) whereimport Protoludeimport Test.E2ESupport+import UnliftIO.Directorytest_project_show_id :: TestTreetest_project_show_id = testCase "project show-id" $ do- _ <- runTestCommand "rad-key" ["create"]- _ <- runTestCommand "git" ["config", "--global", "user.name", "Alice"]- _ <- runTestCommand "git" ["config", "--global", "user.email", "[email protected]"]+ prepareRadicle+_ <- runTestCommand' "rad-project" ["init"] ["project-name", "project desc", "1"]projectId <- runTestCommand "git" ["config", "--get" ,"radicle.project-id"]showIdOut <- runTestCommand' "rad-project" ["show-id"] []assertContains showIdOut projectId++test_project_checkout :: TestTree+test_project_checkout = testCase "project checkout" $ do+ prepareRadicle++ createDirectory "origin"+ projectId <- withCurrentDirectory "origin" $ do+ _ <- runTestCommand' "rad-project" ["init"] ["project-name", "project desc", "1"]+ runTestCommand "git" ["config", "--get" ,"radicle.project-id"]++ runTestCommand "rad-project" ["checkout", projectId]+ withCurrentDirectory "project-name" $ do+ showIdOut <- runTestCommand' "rad-project" ["show-id"] []+ assertContains showIdOut projectIddiff --git a/test/e2e/Test/E2ESupport.hs b/test/e2e/Test/E2ESupport.hsindex 10308b4..d1df60f 100644--- a/test/e2e/Test/E2ESupport.hs+++ b/test/e2e/Test/E2ESupport.hs@@ -10,6 +10,8 @@ module Test.E2ESupport, testCaseSteps, testCase+ , prepareRadicle+, runTestCommand, runTestCommand'@@ -97,6 +99,15 @@ assertContains str substr =then pure ()else assertFailure $ "\"" <> substr <> "\" is not contained in \"" <> str <> "\""+-- * Setup++-- | Runs @rad key create@ and sets the Git user name and email.+prepareRadicle :: TestM Text+prepareRadicle = do+ _ <- runTestCommand "rad-key" ["create"]+ _ <- runTestCommand "git" ["config", "--global", "user.name", "Alice"]+ runTestCommand "git" ["config", "--global", "user.email", "[email protected]"]+-- * Run commands-- | Like 'runTestCommand'' but does not provide input to stdin.