[test] simple worker unit tests

parent 1281c36d
Pipeline #6517 failed with stages
in 12 minutes and 2 seconds
......@@ -887,6 +887,7 @@ test-suite garg-test-tasty
Test.Core.Text.Examples
Test.Core.Text.Flow
Test.Core.Utils
Test.Core.Worker
Test.Database.Operations
Test.Database.Operations.DocumentSearch
Test.Database.Operations.NodeStory
......
......@@ -22,3 +22,5 @@ use-origins-for-hosts = true
[microservices.proxy]
port = 8009
enabled = false
[worker]
\ No newline at end of file
{-|
Module : Test.Core.Worker
Description :
Copyright : (c) CNRS, 2024-Present
License : AGPL + CECILL v3
Maintainer : team@gargantext.org
Stability : experimental
Portability : POSIX
-}
module Test.Core.Worker where
import Data.Aeson qualified as Aeson
import Gargantext.Core.Methods.Similarities.Conditional
import Gargantext.Core.Worker.Jobs (Job(..))
import Gargantext.Prelude
import Test.Tasty
import Test.Tasty.HUnit
import Test.Tasty.QuickCheck hiding (Positive, Negative)
instance Arbitrary Job where
arbitrary = oneof [ pure Ping ]
tests :: TestTree
tests = testGroup "worker unit tests" [
testProperty "Worker Job to/from JSON serialization is correct" $
\job -> Aeson.decode (Aeson.encode (job :: Job)) == Just job
]
......@@ -15,6 +15,7 @@ import Gargantext.Prelude
import qualified Test.Core.Text.Corpus.Query as CorpusQuery
import qualified Test.Core.Text.Corpus.TSV as TSVParser
import qualified Test.Core.Utils as Utils
import qualified Test.Core.Worker as Worker
import qualified Test.Graph.Clustering as Graph
import qualified Test.Ngrams.NLP as NLP
import qualified Test.Ngrams.Query as NgramsQuery
......@@ -55,4 +56,5 @@ main = do
, similaritySpec
, Phylo.tests
, testGroup "Stemming" [ Lancaster.tests ]
, Worker.tests
]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment