From 653da77b5d20ad2f52d1888c4d9499d9dd06a384 Mon Sep 17 00:00:00 2001 From: Robin Stumm Date: Wed, 11 Jan 2023 15:57:52 +0100 Subject: [PATCH 1/2] add flake outputs that cicero expects This is a partial backport of 04c1e174d24377cf7108c1abc21ff16af4966668 --- flake.nix | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/flake.nix b/flake.nix index 00647cc94f7..0c2c969852f 100644 --- a/flake.nix +++ b/flake.nix @@ -397,9 +397,8 @@ } ); - makeRequired = isPr: extra: + makeRequired = isPr: jobs: extra: let - jobs = lib.foldl' lib.mergeAttrs { } (lib.attrValues flake.systemHydraJobs); nonRequiredPaths = map lib.hasPrefix ([ "macos." ] ++ lib.optional isPr "linux.native.membenches"); in with self.legacyPackages.${defaultSystem}; releaseTools.aggregate { @@ -412,6 +411,14 @@ jobs) ++ extra; }; + makeOsRequired = isPr: jobs: { + linux = jobs.linux // { + required = makeRequired isPr jobs.linux []; + }; + macos = jobs.macos // { + required = makeRequired isPr jobs.macos []; + }; + }; hydraJobs = let @@ -422,8 +429,8 @@ build-version = writeText "version.json" (builtins.toJSON { inherit (self) lastModified lastModifiedDate narHash outPath shortRev rev; }); - required = makeRequired false [ cardano-deployment build-version ]; - }); + required = makeRequired false jobs [ cardano-deployment build-version ]; + }) // makeOsRequired false jobs; hydraJobsPr = let @@ -432,14 +439,15 @@ "linux.native.workbench-ci-analysis" "linux.native.workbench-ci-test" ]; - in - (lib.mapAttrsRecursiveCond (v: !(lib.isDerivation v)) - (path: value: - let stringPath = lib.concatStringsSep "." path; in if lib.isAttrs value && (lib.any (p: p stringPath) nonPrJobs) then { } else value) - hydraJobs) // { - required = makeRequired true [ hydraJobs.cardano-deployment hydraJobs.build-version ]; - }; + jobs = lib.mapAttrsRecursiveCond (v: !(lib.isDerivation v)) + (path: value: + let stringPath = lib.concatStringsSep "." path; in if lib.isAttrs value && (lib.any (p: p stringPath) nonPrJobs) then { } else value) + hydraJobs; + in + jobs // { + required = makeRequired true jobs [ hydraJobs.cardano-deployment hydraJobs.build-version ]; + } // makeOsRequired true jobs; in builtins.removeAttrs flake [ "systemHydraJobs" ] // { From 500d7f4e79995fd77d4a6c98d0f63347b103bcef Mon Sep 17 00:00:00 2001 From: Marcin Szamotulski Date: Thu, 12 Jan 2023 14:15:51 +0100 Subject: [PATCH 2/2] Various fixes --- bench/tx-generator/src/Cardano/Benchmarking/Script/Setters.hs | 1 + bench/tx-generator/src/Cardano/Benchmarking/Script/Store.hs | 1 + cardano-node-chairman/test/Spec/Network.hs | 4 ++-- cardano-testnet/test/Spec/Cli/Babbage/LeadershipSchedule.hs | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/bench/tx-generator/src/Cardano/Benchmarking/Script/Setters.hs b/bench/tx-generator/src/Cardano/Benchmarking/Script/Setters.hs index 8ebb63a0e3e..23711ca9e98 100644 --- a/bench/tx-generator/src/Cardano/Benchmarking/Script/Setters.hs +++ b/bench/tx-generator/src/Cardano/Benchmarking/Script/Setters.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE ScopedTypeVariables #-} diff --git a/bench/tx-generator/src/Cardano/Benchmarking/Script/Store.hs b/bench/tx-generator/src/Cardano/Benchmarking/Script/Store.hs index 91ea22583e3..ad481c32c82 100644 --- a/bench/tx-generator/src/Cardano/Benchmarking/Script/Store.hs +++ b/bench/tx-generator/src/Cardano/Benchmarking/Script/Store.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE ScopedTypeVariables #-} diff --git a/cardano-node-chairman/test/Spec/Network.hs b/cardano-node-chairman/test/Spec/Network.hs index 351bcb95976..9e488a18298 100644 --- a/cardano-node-chairman/test/Spec/Network.hs +++ b/cardano-node-chairman/test/Spec/Network.hs @@ -33,7 +33,7 @@ import qualified System.Random as IO import qualified UnliftIO.Exception as IO hprop_isPortOpen_False :: Property -hprop_isPortOpen_False = H.propertyOnce . H.workspace "temp/network" $ \_ -> do +hprop_isPortOpen_False = H.propertyOnce $ do -- Check multiple random ports and assert that one is closed. -- Multiple random ports are checked because there is a remote possibility a random -- port is actually open by another program @@ -42,7 +42,7 @@ hprop_isPortOpen_False = H.propertyOnce . H.workspace "temp/network" $ \_ -> do H.assert (False `L.elem` results) hprop_isPortOpen_True :: Property -hprop_isPortOpen_True = H.propertyOnce . H.workspace "temp/network" $ \_ -> do +hprop_isPortOpen_True = H.propertyOnce $ do -- Check first random port from multiple possible ports to be successfully bound is open -- Multiple random ports are checked because there is a remote possibility a random -- port is actually open by another program diff --git a/cardano-testnet/test/Spec/Cli/Babbage/LeadershipSchedule.hs b/cardano-testnet/test/Spec/Cli/Babbage/LeadershipSchedule.hs index 2efe4e4d6bb..7ff2dcdf8d8 100644 --- a/cardano-testnet/test/Spec/Cli/Babbage/LeadershipSchedule.hs +++ b/cardano-testnet/test/Spec/Cli/Babbage/LeadershipSchedule.hs @@ -116,7 +116,7 @@ hprop_leadershipSchedule = H.integration . H.runFinallies . H.workspace "alonzo" leadershipScheduleDeadline <- H.noteShowM $ DTC.addUTCTime 180 <$> H.noteShowIO DTC.getCurrentTime - H.byDeadlineM 5 leadershipScheduleDeadline $ do + H.byDeadlineM 5 leadershipScheduleDeadline "leadershipSchedule:current:error" $ do void $ H.execCli' execConfig [ "query", "leadership-schedule" , "--testnet-magic", show @Int testnetMagic @@ -157,7 +157,7 @@ hprop_leadershipSchedule = H.integration . H.runFinallies . H.workspace "alonzo" leadershipScheduleDeadline <- H.noteShowM $ DTC.addUTCTime 180 <$> H.noteShowIO DTC.getCurrentTime - H.byDeadlineM 5 leadershipScheduleDeadline $ do + H.byDeadlineM 5 leadershipScheduleDeadline "leadershipSchedule:next:error" $ do void $ H.execCli' execConfig [ "query", "leadership-schedule" , "--testnet-magic", show @Int testnetMagic