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
159
Issues
159
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
35306b4d
Verified
Commit
35306b4d
authored
Nov 19, 2024
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[test] some fixes, more arbitrary moved to instances
parent
2d61da1c
Pipeline
#6993
passed with stages
in 73 minutes and 4 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
18 deletions
+15
-18
API.hs
src/Gargantext/API.hs
+4
-6
Core.hs
src/Gargantext/Core.hs
+4
-8
Types.hs
src/Gargantext/Core/Types.hs
+0
-4
Instances.hs
test/Test/Instances.hs
+7
-0
No files found.
src/Gargantext/API.hs
View file @
35306b4d
...
...
@@ -34,7 +34,6 @@ Pouillard (who mainly made it).
module
Gargantext.API
where
import
Control.Concurrent
import
Control.Concurrent.Async
qualified
as
Async
import
Data.Cache
qualified
as
InMemory
import
Data.List
(
lookup
)
...
...
@@ -42,13 +41,12 @@ import Data.Set qualified as Set
import
Data.Text
(
pack
)
import
Data.Text.Encoding
qualified
as
TE
import
Data.Text.IO
(
putStrLn
)
import
Data.Validity
import
Gargantext.API.Admin.Auth.Types
(
AuthContext
)
import
Gargantext.API.Admin.EnvTypes
(
Env
,
FireWall
(
..
),
Mode
(
..
),
env_config
,
env_jwt_settings
)
import
Gargantext.API.Admin.Settings
(
newEnv
)
import
Gargantext.API.Middleware
(
logStdoutDevSanitised
)
import
Gargantext.API.Routes.Named
(
API
)
import
Gargantext.API.Routes.Named.EKG
import
Gargantext.API.Routes.Named.EKG
(
EkgAPI
)
import
Gargantext.API.Server.Named
(
server
)
import
Gargantext.Core.Config
(
gc_notifications_config
,
gc_frontend_config
)
import
Gargantext.Core.Config.Types
(
CORSOrigin
(
..
),
CORSSettings
,
MicroServicesProxyStatus
(
..
),
NotificationsConfig
(
..
),
PortNumber
,
SettingsFile
(
..
),
corsAllowedOrigins
,
fc_appPort
,
fc_cors
,
fc_cookie_settings
,
microServicesProxyStatus
)
...
...
@@ -57,12 +55,12 @@ import Gargantext.Core.Notifications (withNotifications)
import
Gargantext.Database.Prelude
qualified
as
DB
import
Gargantext.MicroServices.ReverseProxy
(
microServicesProxyApp
)
import
Gargantext.Prelude
hiding
(
putStrLn
,
to
)
import
Gargantext.System.Logging
import
Gargantext.System.Logging
(
withLoggerHoisted
)
import
Network.HTTP.Types
hiding
(
Query
)
import
Network.Wai
import
Network.Wai
(
Middleware
,
Request
,
requestHeaders
)
import
Network.Wai.Handler.Warp
hiding
(
defaultSettings
)
import
Network.Wai.Middleware.Cors
import
Network.Wai.Middleware.RequestLogger
import
Network.Wai.Middleware.RequestLogger
(
logStdout
)
-- import Paths_gargantext (getDataDir)
import
Servant
hiding
(
Header
)
import
Servant.Client.Core.BaseUrl
(
showBaseUrl
)
...
...
src/Gargantext/Core.hs
View file @
35306b4d
...
...
@@ -16,17 +16,15 @@ module Gargantext.Core
where
import
Control.Exception.Safe
(
impureThrow
)
import
Data.Aeson
import
Data.LanguageCodes
qualified
as
ISO639
import
Data.Bimap
qualified
as
Bimap
import
Data.Bimap
(
Bimap
)
import
Data.Bimap
qualified
as
Bimap
import
Data.LanguageCodes
qualified
as
ISO639
import
Data.Morpheus.Types
(
GQLType
)
import
Data.Swagger
import
Data.Swagger
(
ToSchema
(
..
),
defaultSchemaOptions
,
genericDeclareNamedSchemaUnrestricted
)
import
Data.Text
(
pack
)
import
Gargantext.Prelude
hiding
(
All
)
import
Servant.API
import
Test.QuickCheck
import
Prelude
(
userError
)
import
Servant.API
(
FromHttpApiData
(
..
),
ToHttpApiData
(
..
),
URI
)
------------------------------------------------------------------------
-- | Language of a Text
...
...
@@ -83,8 +81,6 @@ instance FromHttpApiData Lang
instance
ToHttpApiData
Lang
where
toUrlPiece
=
pack
.
show
instance
Hashable
Lang
instance
Arbitrary
Lang
where
arbitrary
=
arbitraryBoundedEnum
toISO639
::
Lang
->
ISO639
.
ISO639_1
toISO639
DE
=
ISO639
.
DE
...
...
src/Gargantext/Core/Types.hs
View file @
35306b4d
...
...
@@ -41,7 +41,6 @@ import Gargantext.Core.Types.Main
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
wellNamedSchema
)
import
Gargantext.Database.Admin.Types.Node
import
Gargantext.Prelude
hiding
(
Ordering
,
empty
)
import
Test.QuickCheck.Arbitrary
(
Arbitrary
,
arbitrary
)
------------------------------------------------------------------------
...
...
@@ -185,9 +184,6 @@ $(deriveJSON (unPrefix "tr_") ''TableResult)
instance
(
Typeable
a
,
ToSchema
a
)
=>
ToSchema
(
TableResult
a
)
where
declareNamedSchema
=
wellNamedSchema
"tr_"
instance
Arbitrary
a
=>
Arbitrary
(
TableResult
a
)
where
arbitrary
=
TableResult
<$>
arbitrary
<*>
arbitrary
----------------------------------------------------------------------------
data
Typed
a
b
=
Typed
{
_withType
::
a
...
...
test/Test/Instances.hs
View file @
35306b4d
...
...
@@ -39,8 +39,10 @@ import Gargantext.API.Node.Share.Types (ShareNodeParams(..))
import
Gargantext.API.Node.Update.Types
qualified
as
NU
import
Gargantext.API.Node.Types
(
NewWithForm
,
RenameNode
(
..
),
WithQuery
)
import
Gargantext.API.Viz.Types
(
PhyloData
)
import
Gargantext.Core
(
Lang
)
import
Gargantext.Core.Notifications.CentralExchange.Types
qualified
as
CET
import
Gargantext.Core.Notifications.Dispatcher.Types
qualified
as
DET
import
Gargantext.Core.Types
(
TableResult
)
import
Gargantext.Core.Types.Individu
qualified
as
Individu
import
Gargantext.Core.Types.Main
(
ListType
(
CandidateTerm
,
StopTerm
,
MapTerm
))
import
Gargantext.Core.Viz.Phylo
qualified
as
Phylo
...
...
@@ -98,6 +100,8 @@ alphanum :: [Char]
alphanum
=
smallLetter
<>
largeLetter
<>
digit
instance
(
Arbitrary
a
,
Generic
a
)
=>
Arbitrary
(
TableResult
a
)
where
arbitrary
=
genericArbitrary
instance
Arbitrary
Individu
.
User
where
arbitrary
=
genericArbitrary
...
...
@@ -211,6 +215,9 @@ instance Arbitrary Phylo.TimeUnit where arbitrary = genericArbitrary
instance
Arbitrary
PhyloData
where
arbitrary
=
genericArbitrary
instance
Arbitrary
Lang
where
arbitrary
=
arbitraryBoundedEnum
instance
Arbitrary
NU
.
UpdateNodeParams
where
arbitrary
=
genericArbitrary
instance
Arbitrary
NU
.
Method
where
arbitrary
=
arbitraryBoundedEnum
instance
Arbitrary
NU
.
Granularity
where
arbitrary
=
arbitraryBoundedEnum
...
...
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