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
191
Issues
191
List
Board
Labels
Milestones
Merge Requests
8
Merge Requests
8
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
ff0a77fb
Verified
Commit
ff0a77fb
authored
Jul 10, 2025
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[nix] some attempt to make tests work
parent
ac6ce3c0
Pipeline
#7745
failed with stages
in 56 minutes and 33 seconds
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
153 additions
and
131 deletions
+153
-131
.gitlab-ci.yml
.gitlab-ci.yml
+41
-0
flake.nix
flake.nix
+12
-23
gargantext.nix
nix/haskell.nix/modules/gargantext.nix
+99
-107
Main.hs
test/Main.hs
+1
-1
No files found.
.gitlab-ci.yml
View file @
ff0a77fb
...
...
@@ -107,3 +107,44 @@ test:
chown -R root:root /root/
chown -R root:root $STORE_DIR
chown -R root:root /root/.cache/cabal/logs/
test-flake
:
stage
:
test
# The tests needs to run as the 'test' user, because they leverage the
# initdb utility from postgres that cannot be run by 'root'.
before_script
:
-
echo "Creating test user..."
-
mkdir -p /home/test
-
mkdir -p /root/.config
-
useradd -U test
-
chown -R test:test dist-newstyle/
-
chown -R test:test /root/
-
chown -R test:test $STORE_DIR
-
chown -R test:test ${CABAL_DIR}
-
mkdir -p "$XDG_CACHE_HOME/nix"
-
chown -R test:test "$XDG_CACHE_HOME/nix"
cache
:
key
:
cabal.project
paths
:
-
dist-newstyle/
-
.cabal/
policy
:
pull-push
script
:
-
|
git config --global --add safe.directory $XDG_CACHE_HOME/nix/tarball-cache
git config --global --add safe.directory '*'
export TEST_TMPDIR="${CI_PROJECT_DIR}/tmp"
mkdir -p "$TEST_TMPDIR"
nix-shell --run "./bin/update-project-dependencies $STORE_DIR"
mkdir -p /root/.cache/cabal/logs
chown -R test:test /root/.cache/cabal/logs/
chown -R test:test "$TEST_TMPDIR"
chown -R test:test /root/.config/
su -m test -c "export TMPDIR=$TEST_TMPDIR && cd /builds/gargantext/haskell-gargantext; nix run .#gargantext:test:garg-test"
chown -R root:root dist-newstyle/
chown -R root:root /root/
chown -R root:root $STORE_DIR
chown -R root:root /root/.cache/cabal/logs/
flake.nix
View file @
ff0a77fb
...
...
@@ -209,12 +209,12 @@
# Preserve rev for the inputMap
passthru
.
rev
=
src
.
rev
;
};
applyPatches
=
inputName
:
patches
:
pkgs
.
buildPackages
.
applyPatches
{
name
=
"
${
inputName
}
-patched"
;
src
=
inputs
.
${
inputName
};
inherit
patches
;
}
//
{
inherit
(
inputs
.
${
inputName
})
rev
;
};
#
applyPatches = inputName: patches: pkgs.buildPackages.applyPatches
#
{
#
name = "${inputName}-patched";
#
src = inputs.${inputName};
#
inherit patches;
#
} // { inherit (inputs.${inputName}) rev; };
in
{
#"https://github.com/AccelerateHS/accelerate-llvm.git" = inputs.accelerate-llvm;
...
...
@@ -295,6 +295,9 @@
};
packages
.
llvm-hs
.
components
.
library
.
build-tools
=
lib
.
mkOverride
49
[
pkgs
.
llvmPackages_12
.
llvm
];
#packages.gargantext.components.tests.garg-test.systemDepends = [ pkgs.postgresql_14 ];
packages
.
postgresql-simple
.
components
.
library
.
libs
=
[
pkgs
.
postgresql_14
];
})
];
...
...
@@ -541,31 +544,17 @@
''
;
};
};
# For garg-test-hspec
coreNLP
=
pkgs
.
callPackage
./nix/corenlp.nix
{
};
# # Avoid recompiling openjdk due to any overlay used in the common pkgs.
# let pkgs = import inputs.nixpkgs { inherit system; }; in
# inputs.flake-utils.lib.mkApp {
# drv = pkgs.writeShellApplication {
# name = "coreNLP";
# text = ''
# set -x
# exec ${pkgs.openjdk}/bin/java -mx4g -cp '${inputs.coreNLP}/*' edu.stanford.nlp.pipeline.StanfordCoreNLPServer -port 9000 -timeout 15000
# '';
# };
# };
};
# For running all checks (very slow):
# $ nix -L flake check
#
# For building a specific check of the project:
# $ nix -L build .#project.hsPkgs.gargantext.components.tests.garg-test
-tasty
# $ result/bin/garg-test
-tasty
# $ nix -L build .#project.hsPkgs.gargantext.components.tests.garg-test
# $ result/bin/garg-test
#
# Alternatively, but slower:
# $ nix -L build .#checks.x86_64-linux.gargantext:test:garg-test
-tasty
# $ nix -L build .#checks.x86_64-linux.gargantext:test:garg-test
# $ bat result/test-stdout
#
# See names from:
...
...
nix/haskell.nix/modules/gargantext.nix
View file @
ff0a77fb
...
...
@@ -9,7 +9,7 @@
export GARGANTEXT_CORENLP_SERVER="
${
pkgs
.
nixVersions
.
stable
}
/bin/nix run .#coreNLP"
''
;
packages
.
gargantext
.
components
.
tests
.
garg-test
-hspec
.
testFlags
=
[
packages
.
gargantext
.
components
.
tests
.
garg-test
.
testFlags
=
[
# FIXME:
# test/Test/Database/Operations.hs:64:7:
# 1) Database.Read/Writes, Corpus creation, Can add documents to a Corpus
...
...
@@ -32,19 +32,12 @@
# (ConnectionFailure Network.Socket.connect: <socket: 18>: does not exist (Connection refused))
"--match"
"'!/Database/Read/Writes/Corpus creation/Can add documents to a Corpus/'"
];
# Beware those failures are non-deterministic.
# For reproducing it may help to use a project's variant like "coverage":
# $ nix -L build .#project.projectVariants.coverage.hsPkgs.gargantext.components.tests.garg-test-tasty
# $ for i in {1..100}; do result/bin/garg-test-tasty --hide-successes || break; done
# Note that testFlags are only applied on checks.*, not on tests.*
packages
.
gargantext
.
components
.
tests
.
garg-test-tasty
=
{
build-tools
=
[
pkgs
.
graphviz
];
testFlags
=
[
"--pattern"
(
"'"
+
lib
.
concatStringsSep
" && "
[
# FAIL: (non-deterministic)
# Graph Clustering
...
...
@@ -145,7 +138,6 @@
"!/Conditional/"
]
+
"'"
)
];
};
})
];
}
test/Main.hs
View file @
ff0a77fb
...
...
@@ -74,7 +74,7 @@ killProcessTree :: (Handle, Handle, ProcessHandle) -> IO ()
killProcessTree
(
_
,
_
,
ph
)
=
do
pid
<-
getPid
ph
case
pid
of
Nothing
->
putText
"Process already terminated"
Nothing
->
putText
"
[killProcessTree]
Process already terminated"
Just
p
->
do
pgid
<-
getProcessGroupIDOf
p
signalProcessGroup
keyboardSignal
pgid
...
...
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