Commit 91b9a851 authored by Florian Franzen's avatar Florian Franzen
Browse files

split tests from spec

parent 05c81eca
{ polkadot-spec, buildGoModule, patchelf, glibc }:
{ polkadot-tests, buildGoModule, patchelf, glibc }:
buildGoModule rec {
pname = "gossamer-adapter";
version = builtins.substring 0 7 polkadot-spec.rev;
version = builtins.substring 0 7 polkadot-tests.rev;
src = polkadot-spec;
src = polkadot-tests;
modRoot = "test/adapters/gossamer";
modRoot = "adapters/gossamer";
runVend = true;
......
{ polkadot-spec, stdenv, cmake, kagome-host, libyamlcpp }:
{ polkadot-tests, stdenv, cmake, kagome-host, libyamlcpp }:
stdenv.mkDerivation {
pname = "kagome-adapter";
version = builtins.substring 0 7 polkadot-spec.rev;
version = builtins.substring 0 7 polkadot-tests.rev;
src = polkadot-spec;
src = polkadot-tests;
sourceRoot = "source/test/adapters/kagome";
sourceRoot = "source/adapters/kagome";
nativeBuildInputs = [ cmake ];
......
......@@ -68,12 +68,29 @@
"type": "github"
}
},
"polkadot-tests": {
"flake": false,
"locked": {
"lastModified": 1619441161,
"narHash": "sha256-UkJ8cTKNH4y9cJIJ1XXBwcgvEi+dsMYlAyYLyH1+Kwk=",
"owner": "w3f",
"repo": "polkadot-tests",
"rev": "b2c3b676d0dec89cc21bdfeddd98e95c152457be",
"type": "github"
},
"original": {
"owner": "w3f",
"repo": "polkadot-tests",
"type": "github"
}
},
"root": {
"inputs": {
"mozilla": "mozilla",
"naersk": "naersk",
"nixpkgs": "nixpkgs",
"polkadot-spec": "polkadot-spec",
"polkadot-tests": "polkadot-tests",
"utils": "utils"
}
},
......
......@@ -18,7 +18,8 @@
};
# Polkadot specification and testsuite repo
polkadot-spec = { url = "github:w3f/polkadot-spec"; flake = false; };
polkadot-spec = { url = "github:w3f/polkadot-spec"; flake = false; };
polkadot-tests = { url = "github:w3f/polkadot-tests"; flake = false; };
};
outputs = { self, utils, nixpkgs, naersk, ... } @ sources :
......@@ -51,6 +52,6 @@
) // {
checks.x86_64-linux = self.packages.x86_64-linux;
overlay = import ./overlay.nix { inherit (sources) polkadot-spec; };
overlay = import ./overlay.nix { inherit (sources) polkadot-spec polkadot-tests; };
};
}
{ polkadot-spec, buildGoModule, patchelf, glibc }:
{ polkadot-tests, buildGoModule, patchelf, glibc }:
buildGoModule rec {
pname = "gossamer-host";
version = builtins.substring 0 7 polkadot-spec.rev;
version = builtins.substring 0 7 polkadot-tests.rev;
src = polkadot-spec;
src = polkadot-tests;
sourceRoot = "source/test/hosts/gossamer";
sourceRoot = "source/hosts/gossamer";
patches = [ ./config_path.patch ];
......
{ polkadot-spec
{ polkadot-tests
, stdenv
, cmake
, openssl
......@@ -21,11 +21,11 @@
stdenv.mkDerivation rec {
pname = "kagome-host";
version = builtins.substring 0 7 polkadot-spec.rev;
version = builtins.substring 0 7 polkadot-tests.rev;
src = polkadot-spec;
src = polkadot-tests;
sourceRoot = "source/test/hosts/kagome";
sourceRoot = "source/hosts/kagome";
patches = [
./dependencies.patch
......
{ polkadot-spec }:
{ polkadot-spec, polkadot-tests }:
# Web3 Specification Team Nix Overlay
......@@ -69,12 +69,15 @@ let
# Specification Testsuite binaries (buildable)
specifications = with final; {
inherit polkadot-spec;
# Turn source in derivation including submodules
polkadot-spec = builtins.fetchGit {
url = "git://github.com/w3f/polkadot-spec";
inherit (polkadot-spec) rev;
polkadot-tests = builtins.fetchGit {
url = "git://github.com/w3f/polkadot-tests";
ref = "main";
inherit (polkadot-tests) rev;
submodules = true;
};
};
# Publications
polkadot-host-spec = callPackage ./spec/host.nix {};
......
{ polkadot-spec, naerskWasm }:
{ polkadot-tests, naerskWasm }:
naerskWasm.buildPackage rec {
name = "hostapi-runtime";
version = builtins.substring 0 7 polkadot-spec.rev;
version = builtins.substring 0 7 polkadot-tests.rev;
src = "${polkadot-spec}/test/runtimes/hostapi";
src = "${polkadot-tests}/runtimes/hostapi";
overrideMain = _: {
name = "hostapi-runtime-${version}.compact.wasm";
......
{ polkadot-spec, naerskWasm, protobuf }:
{ polkadot-tests, naerskWasm, protobuf }:
naerskWasm.buildPackage {
pname = "tester-runtime";
version = builtins.substring 0 7 polkadot-spec.rev;
version = builtins.substring 0 7 polkadot-tests.rev;
src = "${polkadot-spec}/test/runtimes/tester";
src = "${polkadot-tests}/runtimes/tester";
# Needed to build rust-libp2p
PROTOC = "${protobuf}/bin/protoc";
......
{ polkadot-spec, stdenv }:
{ polkadot-tests, stdenv }:
stdenv.mkDerivation {
pname = "polkadot-testsuite";
version = builtins.substring 0 7 polkadot-spec.rev;
version = builtins.substring 0 7 polkadot-tests.rev;
src = polkadot-spec;
src = polkadot-tests;
phases = [ "unpackPhase" "installPhase" ];
sourceRoot = "source/test";
installPhase = ''
mkdir -p $out/bin
cp -r runtests.jl fixtures helpers $out/bin
......
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