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
163
Issues
163
List
Board
Labels
Milestones
Merge Requests
9
Merge Requests
9
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
gargantext
haskell-gargantext
Commits
1621a47e
Commit
1621a47e
authored
Mar 25, 2024
by
Alfredo Di Napoli
Committed by
Alfredo Di Napoli
Apr 02, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deterministic Phylo tests
parent
d3b76a5c
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 @
1621a47e
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
"_csv_limit"
:
150000
,
"_csv_limit"
:
150000
,
"tag"
:
"Csv"
"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
,
"defaultMode"
:
false
,
"exportFilter"
:
[
"exportFilter"
:
[
{
{
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
},
},
"findAncestors"
:
true
,
"findAncestors"
:
true
,
"listParser"
:
"V3"
,
"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/"
,
"outputPath"
:
"data/"
,
"phyloName"
:
"Phylo Name"
,
"phyloName"
:
"Phylo Name"
,
"phyloQuality"
:
{
"phyloQuality"
:
{
...
@@ -1640,4 +1640,4 @@
...
@@ -1640,4 +1640,4 @@
"style"
:
"filled"
"style"
:
"filled"
},
},
"pd_listId"
:
187482
"pd_listId"
:
187482
}
}
\ No newline at end of file
test-data/phylo/phylo2dot2json.golden.json
View file @
1621a47e
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 @
1621a47e
This diff is collapsed.
Click to expand it.
test/Test/Offline/Phylo.hs
View file @
1621a47e
...
@@ -56,15 +56,15 @@ phyloConfig = PhyloConfig {
...
@@ -56,15 +56,15 @@ phyloConfig = PhyloConfig {
,
exportFilter
=
[
ByBranchSize
{
_branch_size
=
3.0
}]
,
exportFilter
=
[
ByBranchSize
{
_branch_size
=
3.0
}]
}
}
tests
::
HasCallStack
=>
TestTree
tests
::
TestTree
tests
=
testGroup
"Phylo"
[
tests
=
testGroup
"Phylo"
[
testGroup
"Export"
[
testGroup
"Export"
[
testCase
"ngramsToLabel respects encoding"
test_ngramsToLabel_01
testCase
"ngramsToLabel respects encoding"
test_ngramsToLabel_01
,
testCase
"ngramsToLabel is rendered correctly in CustomAttribute"
test_ngramsToLabel_02
,
testCase
"ngramsToLabel is rendered correctly in CustomAttribute"
test_ngramsToLabel_02
]
]
,
testGroup
"toPhyloWithoutLink"
[
,
testGroup
"toPhyloWithoutLink"
[
test
Property
"returns expected data"
testSmallPhyloWithoutLinkExpectedOutput
test
Case
"returns expected data"
testSmallPhyloWithoutLinkExpectedOutput
,
test
Property
"phyloCleopatre returns expected data"
testCleopatreWithoutLinkExpectedOutput
,
test
Case
"phyloCleopatre returns expected data"
testCleopatreWithoutLinkExpectedOutput
]
]
,
testGroup
"phylo2dot2json"
[
,
testGroup
"phylo2dot2json"
[
testCase
"is deterministic"
testPhylo2dot2json
testCase
"is deterministic"
testPhylo2dot2json
...
@@ -78,28 +78,31 @@ tests = testGroup "Phylo" [
...
@@ -78,28 +78,31 @@ tests = testGroup "Phylo" [
]
]
]
]
testCleopatreWithoutLinkExpectedOutput
::
HasCallStack
=>
Property
testCleopatreWithoutLinkExpectedOutput
::
Assertion
testCleopatreWithoutLinkExpectedOutput
=
monadicIO
$
do
testCleopatreWithoutLinkExpectedOutput
=
do
actual
<-
pure
$
toPhyloWithoutLink
Cleopatre
.
docs
Cleopatre
.
config
let
actual
=
toPhyloWithoutLink
Cleopatre
.
docs
Cleopatre
.
config
expected
<-
r
un
$
r
eadPhylo
=<<
getDataFileName
"test-data/phylo/cleopatre.golden.json"
expected
<-
readPhylo
=<<
getDataFileName
"test-data/phylo/cleopatre.golden.json"
pure
$
counterexample
(
show
$
ansiWlEditExpr
$
ediff'
expected
actual
)
(
expected
=
==
actual
)
assertBool
(
show
$
ansiWlEditExpr
$
ediff'
expected
actual
)
(
expected
==
actual
)
testSmallPhyloWithoutLinkExpectedOutput
::
Property
testSmallPhyloWithoutLinkExpectedOutput
::
Assertion
testSmallPhyloWithoutLinkExpectedOutput
=
monadicIO
$
do
testSmallPhyloWithoutLinkExpectedOutput
=
do
bpaConfig
<-
run
$
getDataFileName
"bench-data/phylo/bpa-config.json"
bpaConfig
<-
getDataFileName
"bench-data/phylo/bpa-config.json"
corpusPath'
<-
run
$
getDataFileName
"test-data/phylo/small_phylo_docslist.csv"
corpusPath'
<-
getDataFileName
"test-data/phylo/small_phylo_docslist.csv"
listPath'
<-
run
$
getDataFileName
"test-data/phylo/small_phylo_ngramslist.csv"
listPath'
<-
getDataFileName
"test-data/phylo/small_phylo_ngramslist.csv"
(
Right
config
)
<-
fmap
(
\
pcfg
->
pcfg
{
corpusPath
=
corpusPath'
(
Right
config
)
<-
fmap
(
\
pcfg
->
pcfg
{
corpusPath
=
corpusPath'
,
listPath
=
listPath'
,
listPath
=
listPath'
})
<$>
(
run
$
eitherDecodeFileStrict'
bpaConfig
)
})
<$>
(
eitherDecodeFileStrict'
bpaConfig
)
mapList
<-
run
$
fileToList
(
listParser
config
)
(
listPath
config
)
mapList
<-
fileToList
(
listParser
config
)
(
listPath
config
)
corpus
<-
run
$
fileToDocsDefault
(
corpusParser
config
)
corpus
<-
fileToDocsDefault
(
corpusParser
config
)
(
corpusPath
config
)
(
corpusPath
config
)
[
Year
3
1
5
,
Month
3
1
5
,
Week
4
2
5
]
[
Year
3
1
5
,
Month
3
1
5
,
Week
4
2
5
]
mapList
mapList
actual
<-
pure
$
toPhyloWithoutLink
corpus
config
actual
<-
phylo2dot2json
(
toPhyloWithoutLink
corpus
config
)
expected
<-
run
$
readPhylo
=<<
getDataFileName
"test-data/phylo/small-phylo.golden.json"
expected_e
<-
JSON
.
eitherDecodeFileStrict'
=<<
getDataFileName
"test-data/phylo/small-phylo.golden.json"
pure
$
counterexample
(
show
$
ansiWlEditExpr
$
ediff'
expected
actual
)
(
expected
===
actual
)
case
expected_e
of
Left
err
->
fail
err
Right
(
expected
::
JSON
.
Value
)
->
do
assertBool
(
show
$
ansiWlEditExpr
$
ediff'
expected
actual
)
(
expected
==
actual
)
testPhylo2dot2json
::
Assertion
testPhylo2dot2json
::
Assertion
testPhylo2dot2json
=
do
testPhylo2dot2json
=
do
...
...
test/drivers/tasty/Main.hs
View file @
1621a47e
...
@@ -29,7 +29,7 @@ import qualified Test.Core.Similarity as Similarity
...
@@ -29,7 +29,7 @@ import qualified Test.Core.Similarity as Similarity
import
Test.Tasty
import
Test.Tasty
import
Test.Tasty.Hspec
import
Test.Tasty.Hspec
main
::
HasCallStack
=>
IO
()
main
::
IO
()
main
=
do
main
=
do
utilSpec
<-
testSpec
"Utils"
Utils
.
test
utilSpec
<-
testSpec
"Utils"
Utils
.
test
clusteringSpec
<-
testSpec
"Graph Clustering"
Graph
.
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