Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Christian Merten
haskell-gargantext
Commits
500ed199
Commit
500ed199
authored
Mar 25, 2024
by
Alfredo Di Napoli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deterministic Phylo tests
parent
14284bc3
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
432 additions
and
4447 deletions
+432
-4447
187481.json
test-data/phylo/187481.json
+3
-3
phylo2dot2json.golden.json
test-data/phylo/phylo2dot2json.golden.json
+1
-4420
small-phylo.golden.json
test-data/phylo/small-phylo.golden.json
+402
-1
Phylo.hs
test/Test/Offline/Phylo.hs
+25
-22
Main.hs
test/drivers/tasty/Main.hs
+1
-1
No files found.
test-data/phylo/187481.json
View file @
500ed199
...
...
@@ -10,7 +10,7 @@
"_csv_limit"
:
150000
,
"tag"
:
"Csv"
},
"corpusPath"
:
"
/Users/adinapoli/work/clients/CNRS/haskell-gargantext/adinapoli-wip2/./
test-data/phylo/GarganText_DocsList-nodeId-187481.csv"
,
"corpusPath"
:
"test-data/phylo/GarganText_DocsList-nodeId-187481.csv"
,
"defaultMode"
:
false
,
"exportFilter"
:
[
{
...
...
@@ -35,7 +35,7 @@
},
"findAncestors"
:
true
,
"listParser"
:
"V3"
,
"listPath"
:
"
/Users/adinapoli/work/clients/CNRS/haskell-gargantext/adinapoli-wip2/./
test-data/phylo/GarganText_NgramsList-187482.csv"
,
"listPath"
:
"test-data/phylo/GarganText_NgramsList-187482.csv"
,
"outputPath"
:
"data/"
,
"phyloName"
:
"Phylo Name"
,
"phyloQuality"
:
{
...
...
@@ -1640,4 +1640,4 @@
"style"
:
"filled"
},
"pd_listId"
:
187482
}
\ No newline at end of file
}
test-data/phylo/phylo2dot2json.golden.json
View file @
500ed199
This source diff could not be displayed because it is too large. You can
view the blob
instead.
test-data/phylo/small-phylo.golden.json
View file @
500ed199
This diff is collapsed.
Click to expand it.
test/Test/Offline/Phylo.hs
View file @
500ed199
...
...
@@ -56,15 +56,15 @@ phyloConfig = PhyloConfig {
,
exportFilter
=
[
ByBranchSize
{
_branch_size
=
3.0
}]
}
tests
::
HasCallStack
=>
TestTree
tests
::
TestTree
tests
=
testGroup
"Phylo"
[
testGroup
"Export"
[
testCase
"ngramsToLabel respects encoding"
test_ngramsToLabel_01
,
testCase
"ngramsToLabel is rendered correctly in CustomAttribute"
test_ngramsToLabel_02
]
,
testGroup
"toPhyloWithoutLink"
[
test
Property
"returns expected data"
testSmallPhyloWithoutLinkExpectedOutput
,
test
Property
"phyloCleopatre returns expected data"
testCleopatreWithoutLinkExpectedOutput
test
Case
"returns expected data"
testSmallPhyloWithoutLinkExpectedOutput
,
test
Case
"phyloCleopatre returns expected data"
testCleopatreWithoutLinkExpectedOutput
]
,
testGroup
"phylo2dot2json"
[
testCase
"is deterministic"
testPhylo2dot2json
...
...
@@ -78,28 +78,31 @@ tests = testGroup "Phylo" [
]
]
testCleopatreWithoutLinkExpectedOutput
::
HasCallStack
=>
Property
testCleopatreWithoutLinkExpectedOutput
=
monadicIO
$
do
actual
<-
pure
$
toPhyloWithoutLink
Cleopatre
.
docs
Cleopatre
.
config
expected
<-
r
un
$
r
eadPhylo
=<<
getDataFileName
"test-data/phylo/cleopatre.golden.json"
pure
$
counterexample
(
show
$
ansiWlEditExpr
$
ediff'
expected
actual
)
(
expected
=
==
actual
)
testCleopatreWithoutLinkExpectedOutput
::
Assertion
testCleopatreWithoutLinkExpectedOutput
=
do
let
actual
=
toPhyloWithoutLink
Cleopatre
.
docs
Cleopatre
.
config
expected
<-
readPhylo
=<<
getDataFileName
"test-data/phylo/cleopatre.golden.json"
assertBool
(
show
$
ansiWlEditExpr
$
ediff'
expected
actual
)
(
expected
==
actual
)
testSmallPhyloWithoutLinkExpectedOutput
::
Property
testSmallPhyloWithoutLinkExpectedOutput
=
monadicIO
$
do
bpaConfig
<-
run
$
getDataFileName
"bench-data/phylo/bpa-config.json"
corpusPath'
<-
run
$
getDataFileName
"test-data/phylo/small_phylo_docslist.csv"
listPath'
<-
run
$
getDataFileName
"test-data/phylo/small_phylo_ngramslist.csv"
testSmallPhyloWithoutLinkExpectedOutput
::
Assertion
testSmallPhyloWithoutLinkExpectedOutput
=
do
bpaConfig
<-
getDataFileName
"bench-data/phylo/bpa-config.json"
corpusPath'
<-
getDataFileName
"test-data/phylo/small_phylo_docslist.csv"
listPath'
<-
getDataFileName
"test-data/phylo/small_phylo_ngramslist.csv"
(
Right
config
)
<-
fmap
(
\
pcfg
->
pcfg
{
corpusPath
=
corpusPath'
,
listPath
=
listPath'
})
<$>
(
run
$
eitherDecodeFileStrict'
bpaConfig
)
mapList
<-
run
$
fileToList
(
listParser
config
)
(
listPath
config
)
corpus
<-
run
$
fileToDocsDefault
(
corpusParser
config
)
(
corpusPath
config
)
[
Year
3
1
5
,
Month
3
1
5
,
Week
4
2
5
]
mapList
actual
<-
pure
$
toPhyloWithoutLink
corpus
config
expected
<-
run
$
readPhylo
=<<
getDataFileName
"test-data/phylo/small-phylo.golden.json"
pure
$
counterexample
(
show
$
ansiWlEditExpr
$
ediff'
expected
actual
)
(
expected
===
actual
)
})
<$>
(
eitherDecodeFileStrict'
bpaConfig
)
mapList
<-
fileToList
(
listParser
config
)
(
listPath
config
)
corpus
<-
fileToDocsDefault
(
corpusParser
config
)
(
corpusPath
config
)
[
Year
3
1
5
,
Month
3
1
5
,
Week
4
2
5
]
mapList
actual
<-
phylo2dot2json
(
toPhyloWithoutLink
corpus
config
)
expected_e
<-
JSON
.
eitherDecodeFileStrict'
=<<
getDataFileName
"test-data/phylo/small-phylo.golden.json"
case
expected_e
of
Left
err
->
fail
err
Right
(
expected
::
JSON
.
Value
)
->
do
assertBool
(
show
$
ansiWlEditExpr
$
ediff'
expected
actual
)
(
expected
==
actual
)
testPhylo2dot2json
::
Assertion
testPhylo2dot2json
=
do
...
...
test/drivers/tasty/Main.hs
View file @
500ed199
...
...
@@ -29,7 +29,7 @@ import qualified Test.Core.Similarity as Similarity
import
Test.Tasty
import
Test.Tasty.Hspec
main
::
HasCallStack
=>
IO
()
main
::
IO
()
main
=
do
utilSpec
<-
testSpec
"Utils"
Utils
.
test
clusteringSpec
<-
testSpec
"Graph Clustering"
Graph
.
test
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment