Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
Nix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nora Puchreiner
Nix
Commits
a0866c8e
Commit
a0866c8e
authored
4 years ago
by
regnat
Browse files
Options
Downloads
Patches
Plain Diff
Make the tests (optionnally) run in another derivation
That way we can run them without rebuilding Nix
parent
eab9cdbd
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
flake.nix
+36
-5
36 additions, 5 deletions
flake.nix
tests/common.sh.in
+6
-0
6 additions, 0 deletions
tests/common.sh.in
with
42 additions
and
5 deletions
flake.nix
+
36
−
5
View file @
a0866c8e
...
...
@@ -144,6 +144,32 @@
echo "file installer $out/install" >> $out/nix-support/hydra-build-products
''
;
testNixVersions
=
pkgs
:
client
:
daemon
:
with
commonDeps
pkgs
;
pkgs
.
stdenv
.
mkDerivation
{
NIX_DAEMON_PACKAGE
=
daemon
;
NIX_CLIENT_PACKAGE
=
client
;
name
=
"nix-tests-
${
client
.
version
}
-against-
${
daemon
.
version
}
"
;
inherit
version
;
src
=
self
;
VERSION_SUFFIX
=
versionSuffix
;
nativeBuildInputs
=
nativeBuildDeps
;
buildInputs
=
buildDeps
++
awsDeps
;
propagatedBuildInputs
=
propagatedDeps
;
enableParallelBuilding
=
true
;
dontBuild
=
true
;
doInstallCheck
=
true
;
installPhase
=
''
mkdir -p $out
''
;
installCheckPhase
=
"make installcheck"
;
};
in
{
# A Nixpkgs overlay that overrides the 'nix' and
...
...
@@ -153,7 +179,7 @@
# An older version of Nix to test against when using the daemon.
# Currently using `nixUnstable` as the stable one doesn't respect
# `NIX_DAEMON_SOCKET_PATH` which is needed for the tests.
mainstream-nix
=
prev
.
nix
Unstable
;
nixStable
=
prev
.
nix
;
nix
=
with
final
;
with
commonDeps
pkgs
;
stdenv
.
mkDerivation
{
name
=
"nix-
${
version
}
"
;
...
...
@@ -163,8 +189,6 @@
VERSION_SUFFIX
=
versionSuffix
;
OUTER_NIX
=
mainstream-nix
;
outputs
=
[
"out"
"dev"
"doc"
];
nativeBuildInputs
=
nativeBuildDeps
;
...
...
@@ -441,6 +465,15 @@
checks
=
forAllSystems
(
system
:
{
binaryTarball
=
self
.
hydraJobs
.
binaryTarball
.
${
system
};
perlBindings
=
self
.
hydraJobs
.
perlBindings
.
${
system
};
installTests
=
let
pkgs
=
nixpkgsFor
.
${
system
};
in
pkgs
.
runCommand
"install-tests"
{
againstSelf
=
testNixVersions
pkgs
pkgs
.
nix
pkgs
.
pkgs
.
nix
;
againstCurrentUnstable
=
testNixVersions
pkgs
pkgs
.
nix
pkgs
.
nixUnstable
;
# Disabled because the latest stable version doesn't handle
# `NIX_DAEMON_SOCKET_PATH` which is required for the tests to work
# againstLatestStable = testNixVersions pkgs pkgs.nix pkgs.nixStable;
}
"touch $out"
;
});
packages
=
forAllSystems
(
system
:
{
...
...
@@ -493,8 +526,6 @@
stdenv
.
mkDerivation
{
name
=
"nix"
;
OUTER_NIX
=
mainstream-nix
;
outputs
=
[
"out"
"dev"
"doc"
];
nativeBuildInputs
=
nativeBuildDeps
;
...
...
This diff is collapsed.
Click to expand it.
tests/common.sh.in
+
6
−
0
View file @
a0866c8e
...
...
@@ -29,6 +29,12 @@ unset XDG_CACHE_HOME
mkdir -p $TEST_HOME
export PATH=@bindir@:$PATH
if [[ -n "${NIX_CLIENT_PACKAGE:-}" ]]; then
export PATH="$NIX_CLIENT_PACKAGE/bin":$PATH
fi
if [[ -n "${NIX_DAEMON_PACKAGE:-}" ]]; then
export NIX_DAEMON_COMMAND="$NIX_DAEMON_PACKAGE/bin/nix-daemon"
fi
coreutils=@coreutils@
export dot=@dot@
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment