Skip to content

Commit

Permalink
Reproduction attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
elldritch committed Jan 11, 2024
1 parent a48355e commit ba0c46a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
14 changes: 12 additions & 2 deletions test/Maven/PluginSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ import Data.Text (Text)
import Data.Tree (Tree (..))
import Strategy.Maven.Plugin (Artifact (..), Edge (..), PluginOutput (..), textArtifactToPluginOutput)
import Strategy.Maven.PluginTree (TextArtifact (..), parseTextArtifact)
import Test.Effect (expectationFailure', it', shouldBe', shouldContain', shouldMatchList')
import Test.Hspec (Spec, describe)
import Test.Effect (expectationFailure', it', shouldBe', shouldContain', shouldMatchList', shouldSatisfy')
import Test.Hspec (Spec, describe, shouldSatisfy)
import Text.Megaparsec (parseMaybe)
import Text.RawString.QQ (r)
import Control.Effect.Lift (sendIO)
import Data.String.Conversion (toText)
import Effect.ReadFS (readContentsParser)
import Path (parseAbsFile)

spec :: Spec
spec = do
Expand Down Expand Up @@ -168,6 +172,12 @@ textArtifactConversionSpec =
resArts `shouldContain'` [kafkaClientCompile]
resArts `shouldContain'` [kafkaClientTest]

it' "TEST TEST TEST" $ do
input <- sendIO $ parseAbsFile "/home/leo/tmp/zd-7531/dependency-graph.txt"
parsed <- readContentsParser parseTextArtifact input
output <- textArtifactToPluginOutput parsed
output `shouldSatisfy'` (const True)

simpleArtifact :: Artifact
simpleArtifact =
Artifact
Expand Down
17 changes: 15 additions & 2 deletions test/Maven/PluginStrategySpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,18 @@ import Strategy.Maven.Plugin (
Edge (Edge, edgeFrom, edgeTo),
PluginOutput (..),
ReactorArtifact (..),
ReactorOutput (..),
ReactorOutput (..), textArtifactToPluginOutput,
)
import Strategy.Maven.PluginStrategy (buildGraph)

import Graphing (shrinkRoots)
import Strategy.Maven.Common (MavenDependency (..))
import Test.Hspec (Spec, describe, it)
import Test.Hspec (Spec, describe, it, shouldBe)
import Path (parseAbsFile)
import Effect.ReadFS (readContentsParser)
import Strategy.Maven.PluginTree (parseTextArtifact)
import Test.Effect (it', shouldBe')
import Control.Effect.Lift (sendIO)

packageOne :: MavenDependency
packageOne = do
Expand Down Expand Up @@ -276,6 +281,14 @@ mavenCrossDependentSubModules =
spec :: Spec
spec = do
describe "buildGraph" $ do
it' "TEST TEST TEST" $ do
input <- sendIO $ parseAbsFile "/home/leo/tmp/zd-7531/dependency-graph.txt"
parsed <- readContentsParser parseTextArtifact input
output <- textArtifactToPluginOutput parsed
-- TODO: Need user's ReactorOutput here
let graph = shrinkRoots $ buildGraph (ReactorOutput []) output
sendIO $ expectDeps [] graph

it "Should produce expected output, without including submodules in test comparison" $ do
let graph = shrinkRoots $ buildGraph (ReactorOutput []) mavenOutput

Expand Down

0 comments on commit ba0c46a

Please sign in to comment.