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
145
Issues
145
List
Board
Labels
Milestones
Merge Requests
6
Merge Requests
6
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
7860c5b2
Commit
7860c5b2
authored
Mar 27, 2025
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/adinapoli/issue-460' into dev-merge
parents
7574fc93
a08e14cc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
8 deletions
+7
-8
List.hs
src/Gargantext/API/Ngrams/List.hs
+1
-2
List.hs
test/Test/API/Private/List.hs
+4
-4
Remote.hs
test/Test/API/Private/Remote.hs
+1
-1
Setup.hs
test/Test/API/Setup.hs
+1
-1
No files found.
src/Gargantext/API/Ngrams/List.hs
View file @
7860c5b2
...
...
@@ -181,8 +181,7 @@ ngramsListFromTSVData tsvData = case decodeTsv of
decodeTsv
=
Vec
.
catMaybes
<$>
Tsv
.
decodeWithP
tsvToNgramsTableMap
(
Tsv
.
defaultDecodeOptions
{
Tsv
.
decDelimiter
=
fromIntegral
(
P
.
ord
'
\t
'
)
})
-- Don't use an header, make it lenient in case the 'forms' are missing.
Tsv
.
NoHeader
Tsv
.
HasHeader
binaryData
-- | Converts a plain TSV 'Record' into an NgramsTableMap
...
...
test/Test/API/Private/List.hs
View file @
7860c5b2
...
...
@@ -39,9 +39,9 @@ tests = sequential $ aroundAll withTestDBAndPort $ do
describe
"Importing terms as TSV"
$
do
it
"
[#381] should work (and return a non-empty list of ngrams
"
$
\
(
SpecContext
testEnv
port
app
_
)
->
do
it
"
should work for TSV with a missing 'forms' column
"
$
\
(
SpecContext
testEnv
port
app
_
)
->
do
cId
<-
newCorpusForUser
testEnv
"alice"
let
log_cfg
=
(
test_config
testEnv
)
^.
gc_logging
let
log_cfg
=
test_config
testEnv
^.
gc_logging
withApplication
app
$
do
withValidLogin
port
"alice"
(
GargPassword
"alice"
)
$
\
clientEnv
token
->
do
([
listId
]
::
[
NodeId
])
<-
protectedJSON
token
"POST"
(
mkUrl
port
(
"/node/"
<>
build
cId
))
[
aesonQQ
|
{"pn_typename":"NodeList","pn_name":"Testing"}
|]
...
...
@@ -50,8 +50,8 @@ tests = sequential $ aroundAll withTestDBAndPort $ do
let
params
=
WithTextFile
{
_wtf_filetype
=
FType
.
TSV
,
_wtf_data
=
simpleNgrams
,
_wtf_name
=
"simple.tsv"
}
ji
<-
checkEither
$
liftIO
$
runClientM
(
add_tsv_to_list
token
listId
params
)
clientEnv
_
<-
pollUntilWorkFinished
log_cfg
port
ji
pendingJob
<-
checkEither
$
liftIO
$
runClientM
(
add_tsv_to_list
token
listId
params
)
clientEnv
_
<-
pollUntilWorkFinished
log_cfg
port
pendingJob
-- Now check that we can retrieve the ngrams, and the ngrams list is not empty!
liftIO
$
do
...
...
test/Test/API/Private/Remote.hs
View file @
7860c5b2
...
...
@@ -45,7 +45,7 @@ withTwoServerInstances action =
where
server1Port
=
8008
server2Port
=
9008
log_cfg
te
=
(
test_config
te
)
^.
gc_logging
log_cfg
te
=
test_config
te
^.
gc_logging
tests
::
Spec
tests
=
sequential
$
aroundAll
withTwoServerInstances
$
do
...
...
test/Test/API/Setup.hs
View file @
7860c5b2
...
...
@@ -153,7 +153,7 @@ withBackendServerAndProxy action =
where
proxyPort
=
8090
cfg
te
=
test_config
te
log_cfg
te
=
(
cfg
te
)
^.
gc_logging
log_cfg
te
=
cfg
te
^.
gc_logging
setupEnvironment
::
TestEnv
->
IO
()
setupEnvironment
env
=
flip
runReaderT
env
$
runTestMonad
$
do
...
...
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