3
0
Fork 0
forked from mirrors/nixpkgs

arduino-cli: enable (most) unittests on Linux

Ofborg fails/hangs on Darwin and I cannot easily debug this.
This commit is contained in:
Stefan Frijters 2023-04-24 23:22:07 +02:00
parent 4042fa838a
commit 51507a3f28
No known key found for this signature in database
GPG key ID: 7619A6BC6E7DFA6F

View file

@ -1,4 +1,4 @@
{ lib, stdenv, buildGoModule, fetchFromGitHub, buildFHSEnv, installShellFiles }:
{ lib, stdenv, buildGoModule, fetchFromGitHub, buildFHSEnv, installShellFiles, go-task }:
let
@ -17,11 +17,37 @@ let
installShellFiles
];
nativeCheckInputs = [
go-task
];
subPackages = [ "." ];
vendorSha256 = "sha256-+5Cj6wdX25fK+Y9czTwRRqCdY+0iarvii9nD3QMDh+c=";
doCheck = false;
postPatch = let
skipTests = [
# tries to "go install"
"TestDummyMonitor"
# try to Get "https://downloads.arduino.cc/libraries/library_index.tar.bz2"
"TestDownloadAndChecksums"
"TestParseArgs"
"TestParseReferenceCores"
"TestPlatformSearch"
"TestPlatformSearchSorting"
];
in ''
substituteInPlace Taskfile.yml \
--replace "go test" "go test -p $NIX_BUILD_CORES -skip '(${lib.concatStringsSep "|" skipTests})'"
'';
doCheck = stdenv.isLinux;
checkPhase = ''
runHook preCheck
task go:test
runHook postCheck
'';
ldflags = [
"-s" "-w" "-X github.com/arduino/arduino-cli/version.versionString=${version}" "-X github.com/arduino/arduino-cli/version.commit=unknown"