From e7bbefa9f336f19cd7e673d49f6316291557b1e9 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Sat, 8 Aug 2020 16:37:44 +0100 Subject: [PATCH] ci(windows): test using GitHub Actions --- pillar.example | 6 ++--- .../integration/windows/controls/pkgs_spec.rb | 26 +++++++++++++++++++ test/salt/pillar/windows.sls | 19 ++++++++++++++ 3 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 test/integration/windows/controls/pkgs_spec.rb create mode 100644 test/salt/pillar/windows.sls diff --git a/pillar.example b/pillar.example index ca927d7..3a00266 100644 --- a/pillar.example +++ b/pillar.example @@ -64,14 +64,14 @@ packages: chocolatey: wanted: - firefox: - install_args: "l=fr-FR" + Firefox: + package_args: "/l:en-GB" packagename: version: '12.04' source: 'mychocolatey/source' force: true unwanted: - - googlechrome + - GoogleChrome snaps: wanted: diff --git a/test/integration/windows/controls/pkgs_spec.rb b/test/integration/windows/controls/pkgs_spec.rb new file mode 100644 index 0000000..984393a --- /dev/null +++ b/test/integration/windows/controls/pkgs_spec.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +pkgs_wanted = %w[Firefox jq notepadplusplus] +pkgs_unwanted = %w[GoogleChrome hg] + +### WANTED +control 'Wanted packages' do + title 'should be installed' + + pkgs_wanted.each do |p| + describe chocolatey_package(p) do + it { should be_installed } + end + end +end + +### UNWANTED +control 'Unwanted packages' do + title 'should be uninstalled' + + pkgs_unwanted.each do |p| + describe chocolatey_package(p) do + it { should_not be_installed } + end + end +end diff --git a/test/salt/pillar/windows.sls b/test/salt/pillar/windows.sls new file mode 100644 index 0000000..ae8149d --- /dev/null +++ b/test/salt/pillar/windows.sls @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +--- +packages: + chocolatey: + required: + pkgs: [] + wanted: + Firefox: + package_args: "/l:en-GB" + jq: + version: '1.5' + # `1.6` already installed on the pre-salted image + force: true + notepadplusplus: + version: '7.8.8' + unwanted: + - GoogleChrome + - hg