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
199
Issues
199
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
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
Expand all
Hide 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
This diff is collapsed.
Click to expand it.
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