Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(test_includes): add MRE for Salt master branch regression #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,19 +131,18 @@ rubocop:
# Make sure the instances listed below match up with
# the `platforms` defined in `kitchen.yml`
# yamllint disable rule:line-length
# default-debian-11-tiamat-py3: {extends: '.test_instance'}
# default-debian-10-tiamat-py3: {extends: '.test_instance'}
# default-debian-9-tiamat-py3: {extends: '.test_instance'}
default-debian-11-master-py3: {extends: '.test_instance'}
default-debian-10-master-py3: {extends: '.test_instance'}
default-debian-9-master-py3: {extends: '.test_instance'}
# default-debian-11-3004-0-py3: {extends: '.test_instance'}
# default-debian-10-3004-0-py3: {extends: '.test_instance'}
# default-debian-9-3004-0-py3: {extends: '.test_instance'}
# default-debian-10-3003-3-py3: {extends: '.test_instance'}
# default-debian-9-3003-3-py3: {extends: '.test_instance'}
# default-debian-10-3002-7-py3: {extends: '.test_instance'}
# default-debian-9-3002-7-py3: {extends: '.test_instance'}
# include-using-dot-notation-debian-11-master-py3: {extends: '.test_instance'}
# include-using-slash-notation-debian-11-master-py3: {extends: '.test_instance'}
include-using-dot-notation-debian-10-master-py3: {extends: '.test_instance'}
include-using-slash-notation-debian-10-master-py3: {extends: '.test_instance'}
# include-using-dot-notation-debian-9-master-py3: {extends: '.test_instance'}
# include-using-slash-notation-debian-9-master-py3: {extends: '.test_instance'}
# include-using-dot-notation-debian-11-3004-0-py3: {extends: '.test_instance'}
# include-using-slash-notation-debian-11-3004-0-py3: {extends: '.test_instance'}
include-using-dot-notation-debian-10-3004-0-py3: {extends: '.test_instance'}
include-using-slash-notation-debian-10-3004-0-py3: {extends: '.test_instance'}
# include-using-dot-notation-debian-9-3004-0-py3: {extends: '.test_instance'}
# include-using-slash-notation-debian-9-3004-0-py3: {extends: '.test_instance'}
# yamllint enable rule:line-length

###############################################################################
Expand Down
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ jobs:
# - env: INSTANCE=default-debian-9-tiamat-py3
- env: INSTANCE=default-debian-11-master-py3
- env: INSTANCE=default-debian-10-master-py3
- env: INSTANCE=include-using-dot-notation-debian-10-master-py3
- env: INSTANCE=include-using-slash-notation-debian-10-master-py3
- env: INSTANCE=default-debian-9-master-py3
# - env: INSTANCE=default-debian-11-3004-0-py3
# - env: INSTANCE=default-debian-10-3004-0-py3
Expand Down
5 changes: 5 additions & 0 deletions TEST/init.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# vim: ft=sls

include:
- .test_includes
6 changes: 6 additions & 0 deletions TEST/test_includes/init.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
# vim: ft=sls

include:
- .package
- .notification
22 changes: 22 additions & 0 deletions TEST/test_includes/notification.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
# vim: ft=sls

{%- from "../map.jinja" import mapdata as TEST with context %}

include:
{#- Use Jinja to construct the relevant include using dots or slashes,
where `TEST.test_includes.include_notation` is either `.` or `/`.

Dot notation is used throughout the SaltStack Formulas organisation, i.e.:
- TEST.test_includes.package

Slash notation is mentioned in the bug report (https://github.com/saltstack/salt/pull/61659), i.e.
- TEST/test_includes/package
#}
- {{ ["TEST", "test_includes", "package"] | join(TEST.test_includes.include_notation) }}

TEST/test_includes/notification/test.show_notification:
test.show_notification:
- text: Package installed
- require:
- pkg: TEST/test_includes/package/pkg.installed
6 changes: 6 additions & 0 deletions TEST/test_includes/package.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
# vim: ft=sls

TEST/test_includes/package/pkg.installed:
pkg.installed:
- name: git
38 changes: 22 additions & 16 deletions kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ provisioner:
salt_copy_filter:
- .kitchen
- .git
state_top:
base:
'*':
- TEST
pillars:
top.sls:
base:
'*':
- TEST

platforms:
## SALT `tiamat`
Expand All @@ -40,7 +49,7 @@ platforms:
run_command: /lib/systemd/systemd
- name: debian-10-master-py3
driver:
image: saltimages/salt-master-py3:debian-10
image: myii/salt-master-py3:debian-10
run_command: /lib/systemd/systemd
- name: debian-9-master-py3
driver:
Expand Down Expand Up @@ -90,20 +99,17 @@ verifier:
- cli

suites:
- name: default
- name: include-using-dot-notation
provisioner:
state_top:
base:
'*':
- TEST._mapdata
- TEST
pillars:
top.sls:
base:
'*':
- TEST
pillars_from_files:
TEST.sls: pillar.example
verifier:
inspec_tests:
- path: test/integration/default
TEST.sls:
TEST:
test_includes:
include_notation: "."
- name: include-using-slash-notation
provisioner:
pillars:
TEST.sls:
TEST:
test_includes:
include_notation: "/"