From 94e296c31d8ffabb6b6cf90c173e13a1d1a2cf8c Mon Sep 17 00:00:00 2001 From: hlolli Date: Wed, 26 May 2021 00:57:51 +0200 Subject: [PATCH 1/2] wip: darwin tests --- .github/workflows/ci.yml | 15 +++++++++++++++ nixops/backends/__init__.py | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d5d2ec066..4415ba4e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,6 +98,21 @@ jobs: run: './ci/check-tests.sh' env: NIX_PATH: "nixpkgs=https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz" + coverage-darwin: + runs-on: macos-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Nix + uses: cachix/install-nix-action@v12 + - name: Prefetch shell.nix + run: "nix-shell --run true" + - name: Coverage + run: "./ci/check-tests.sh" + env: + NIX_PATH: "nixpkgs=https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz" docs: runs-on: ubuntu-latest steps: diff --git a/nixops/backends/__init__.py b/nixops/backends/__init__.py index c716cded2..ac4a9c86f 100644 --- a/nixops/backends/__init__.py +++ b/nixops/backends/__init__.py @@ -592,7 +592,7 @@ def download_file(self, source: str, target: str, recursive: bool = False): ) return self._logged_exec(cmdline) - def get_console_output(self): + def get_console_output(self) -> str: return "(not available for this machine type)\n" From 391378f48dc749a7f855967f017eee313f2a9ec7 Mon Sep 17 00:00:00 2001 From: hlolli Date: Fri, 28 May 2021 21:41:19 +0200 Subject: [PATCH 2/2] fallback easier to nixpkgs import, fixes darwin tests --- nix/eval-machine-info.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/nix/eval-machine-info.nix b/nix/eval-machine-info.nix index aa4103395..98c281a3f 100644 --- a/nix/eval-machine-info.nix +++ b/nix/eval-machine-info.nix @@ -44,11 +44,12 @@ let else import (pkgs.path + "/nixos/lib/eval-config.nix"); pkgs = if flakeUri != null - then - if network ? nixpkgs - then (builtins.head network.nixpkgs).legacyPackages.${system} - else throw "NixOps network must have a 'nixpkgs' attribute" - else (builtins.head (network.network)).nixpkgs or (import { inherit system; }); + then + if network ? nixpkgs + then (builtins.head network.nixpkgs).legacyPackages.${system} + else throw "NixOps network must have a 'nixpkgs' attribute" + else if network ? nixpkgs then (builtins.head (network.nixpkgs)) + else (import { inherit system; }); inherit (pkgs) lib;