mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 00:43:20 +00:00
azure-cli: add tests for cli with extensions/with mutable config
Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
This commit is contained in:
parent
f53f729ecd
commit
ff22f97d32
@ -4,6 +4,7 @@
|
||||
, stdenvNoCC
|
||||
, fetchurl
|
||||
, fetchFromGitHub
|
||||
, runCommand
|
||||
, installShellFiles
|
||||
, python3
|
||||
|
||||
@ -347,6 +348,42 @@ py.pkgs.toPythonApplication (py.pkgs.buildAzureCliPackage rec {
|
||||
passthru = {
|
||||
inherit extensions;
|
||||
withExtensions = extensions: azure-cli.override { withExtensions = extensions; };
|
||||
tests = {
|
||||
# Test the package builds with some extensions configured, and the
|
||||
# wanted extensions are recognized by the CLI and listed in the output.
|
||||
azWithExtensions =
|
||||
let
|
||||
extensions = with azure-cli.extensions; [
|
||||
aks-preview
|
||||
azure-devops
|
||||
rdbms-connect
|
||||
];
|
||||
extensionNames = map (ext: ext.pname) extensions;
|
||||
az = (azure-cli.withExtensions extensions);
|
||||
in
|
||||
runCommand "test-az-with-extensions" { } ''
|
||||
export HOME=$TMPDIR
|
||||
${lib.getExe az} extension list > $out
|
||||
for ext in ${lib.concatStringsSep " " extensionNames}; do
|
||||
if ! grep -q $ext $out; then
|
||||
echo "Extension $ext not found in list"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
'';
|
||||
# Test the package builds with mutable config.
|
||||
# TODO: Maybe we can install an extension from local python wheel to
|
||||
# check mutable extension install still works.
|
||||
azWithMutableConfig =
|
||||
let
|
||||
az = azure-cli.override { withImmutableConfig = false; };
|
||||
in
|
||||
runCommand "test-az-with-immutable-config" { } ''
|
||||
export HOME=$TMPDIR
|
||||
${lib.getExe az} --version || exit 1
|
||||
touch $out
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
|
Loading…
Reference in New Issue
Block a user