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

Testing integration tests. #169

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
ee8c895
Added the ability to set puppet.conf settings via a parameter. (#1)
benjamin-robertson Apr 5, 2023
a394419
Removed unused variable.
benjamin-robertson Apr 6, 2023
832cb3a
Feature update unit tests (#3)
benjamin-robertson May 2, 2024
99e285b
Feature update unit tests (#4)
benjamin-robertson May 10, 2024
b376007
validate pre-reqs (#5)
benjamin-robertson May 10, 2024
b608ed5
Remove old unit tests
benjamin-robertson May 10, 2024
71c85ac
Blank commit for PR
benjamin-robertson May 10, 2024
a89d401
test new pipeline
benjamin-robertson May 13, 2024
9fba940
Removed intergation test
benjamin-robertson May 13, 2024
c212983
check files
benjamin-robertson May 13, 2024
8cff3ee
check files
benjamin-robertson May 13, 2024
b046f01
check webserver
benjamin-robertson May 13, 2024
9cd10cf
check with https
benjamin-robertson May 13, 2024
3f9276d
Create web server
benjamin-robertson May 13, 2024
8b03e77
Create web dir within workspace
benjamin-robertson May 13, 2024
fdef73f
fix path
benjamin-robertson May 13, 2024
43bf99b
Check dir
benjamin-robertson May 13, 2024
c168774
Check bolt avaliable
benjamin-robertson May 13, 2024
6054a92
Correct setup_matrix to setup_vm
benjamin-robertson May 13, 2024
80d38b4
remove matrix
benjamin-robertson May 13, 2024
8fc3a1e
Set local module path
benjamin-robertson May 13, 2024
659d159
set module path
benjamin-robertson May 13, 2024
ad6d492
run task
benjamin-robertson May 13, 2024
8a8aa62
include module path
benjamin-robertson May 13, 2024
08e4d85
certname
benjamin-robertson May 13, 2024
8135824
Try to elevate permissions
benjamin-robertson May 14, 2024
71079d8
check sudoers
benjamin-robertson May 14, 2024
772df63
try with sudo
benjamin-robertson May 14, 2024
597d227
Run with sudo
benjamin-robertson May 14, 2024
ce9e62b
check bundle location
benjamin-robertson May 14, 2024
4d245ac
attempt with path
benjamin-robertson May 14, 2024
c5c89a8
test with changes
benjamin-robertson May 14, 2024
017d42f
test again with localhost
benjamin-robertson May 14, 2024
fab021d
Check webserver
benjamin-robertson May 14, 2024
7295ee6
Move web server to integration
benjamin-robertson May 14, 2024
358d5b1
Test with just integration
benjamin-robertson May 14, 2024
de71565
Remove needs
benjamin-robertson May 14, 2024
597acee
test on multiple test
benjamin-robertson May 14, 2024
5be8add
Seperate windows ruby
benjamin-robertson May 14, 2024
469816d
enable long file path
benjamin-robertson May 14, 2024
e8aaa5c
ruby 3.2
benjamin-robertson May 14, 2024
0b435ba
use windows latest
benjamin-robertson May 14, 2024
031c4f3
Show plans
benjamin-robertson May 16, 2024
31fc726
with sudo
benjamin-robertson May 16, 2024
40fb624
with sudo _e
benjamin-robertson May 16, 2024
b4bd7a2
with bash
benjamin-robertson May 16, 2024
53c28cf
set path
benjamin-robertson May 16, 2024
fce5cf5
check bundle
benjamin-robertson May 16, 2024
db871ab
with bundle path
benjamin-robertson May 16, 2024
095c26a
check sudo options
benjamin-robertson May 16, 2024
2a48e8a
add sudo
benjamin-robertson May 16, 2024
d092e95
edit file
benjamin-robertson May 16, 2024
d292b26
add s
benjamin-robertson May 16, 2024
c2da2d5
run with sudo -E
benjamin-robertson May 16, 2024
4a3eebc
Try without inventory file
benjamin-robertson May 16, 2024
52b418d
Remove webservrer check
benjamin-robertson May 16, 2024
452c232
Added module path
benjamin-robertson May 16, 2024
85f9862
use inventory file
benjamin-robertson May 16, 2024
e7ff2a2
test with task
benjamin-robertson May 16, 2024
695dbcc
check tasks
benjamin-robertson May 16, 2024
9eee652
REmove install task
benjamin-robertson May 16, 2024
c99759a
show plans
benjamin-robertson May 16, 2024
ace8a56
Confirm fact plan works.
benjamin-robertson May 17, 2024
b02bf09
check hosts file
benjamin-robertson May 17, 2024
588b0e0
try with 127.0.0.1
benjamin-robertson May 17, 2024
55c3b49
with local host
benjamin-robertson May 17, 2024
95887fe
with targets plan parameter
benjamin-robertson May 17, 2024
f3dc901
add stdlib
benjamin-robertson May 17, 2024
b34d724
Test with real bolt
benjamin-robertson May 17, 2024
40fe120
assume yes
benjamin-robertson May 17, 2024
e6ab72a
don't modify sudo
benjamin-robertson May 17, 2024
2ea36ae
With updates
benjamin-robertson May 17, 2024
524b1cc
Update integration tests, added pwsh lint
benjamin-robertson May 17, 2024
ab9bad5
Push with acceptance
benjamin-robertson May 17, 2024
915cb4e
test again
benjamin-robertson May 17, 2024
e3aba69
set bolt config
benjamin-robertson May 17, 2024
a13558b
Run tests
benjamin-robertson May 17, 2024
c4d4b49
use the variables
benjamin-robertson May 17, 2024
b863d49
Move to forge modules
benjamin-robertson May 17, 2024
30f6c7e
Set test on PR only
benjamin-robertson May 20, 2024
c962aab
remove plugin helper from repo fixtures.
benjamin-robertson May 20, 2024
cc5698f
supress PSUseShouldProcessForStateChangingFunction
benjamin-robertson May 20, 2024
efee840
try at top
benjamin-robertson May 20, 2024
1b94601
More fixes
benjamin-robertson May 20, 2024
e9d1dcc
move location
benjamin-robertson May 20, 2024
8b5a39e
Missed s
benjamin-robertson May 20, 2024
d504d70
Disable unused sender variable.
benjamin-robertson May 20, 2024
541b1d4
Fix regex to match all characters
benjamin-robertson May 20, 2024
c89835f
Restore old behaviour
benjamin-robertson May 20, 2024
82ad153
Supress other warning.
benjamin-robertson May 20, 2024
417268a
Set scope all
benjamin-robertson May 20, 2024
f942391
Set scope function
benjamin-robertson May 21, 2024
8a3f086
Try without scope set
benjamin-robertson May 21, 2024
6b5f681
remove target
benjamin-robertson May 21, 2024
962277c
Removed unused sender variable
benjamin-robertson May 21, 2024
8418992
Delete unneeded files
benjamin-robertson May 21, 2024
85d91c1
Delete unused plans
benjamin-robertson May 21, 2024
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
7 changes: 7 additions & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,10 @@ fixtures:
facts: 'https://github.com/puppetlabs/puppetlabs-facts.git'
puppet_agent: 'https://github.com/puppetlabs/puppetlabs-puppet_agent.git'
provision: 'https://github.com/puppetlabs/provision.git'
deploy_pe: "https://github.com/jarretlavallee/puppet-deploy_pe"
forge_modules:
ruby_task_helper: "puppetlabs/ruby_task_helper"
stdlib: "puppetlabs/stdlib"
ruby_plugin_helper:
repo: "puppetlabs/ruby_plugin_helper"
ref: "0.2.0"
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "ci"

on:
pull_request:
branches:
- "main"
workflow_dispatch:

jobs:
Spec:
uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main"
with:
runs_on: "ubuntu-20.04"
secrets: "inherit"

Acceptance:
needs: Spec
uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main"
with:
runs_on: "ubuntu-20.04"
secrets: "inherit"
80 changes: 80 additions & 0 deletions .github/workflows/integration_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: "integration"

on:
pull_request:
branches:
- "main"

jobs:

Integration_linux:
runs-on: ubuntu-22.04

env:
PUPPET_GEM_VERSION: '~> 7.24'
FACTER_GEM_VERSION: 'https://github.com/puppetlabs/facter#main'

steps:
- name: checkout source
uses: actions/checkout@v4

- name: Activate Ruby 2.7
uses: ruby/setup-ruby@v1
with:
ruby-version: "2.7"
bundler-cache: true

- name: Print bundle environment
run: |
echo ::group::bundler environment
bundle env
echo ::endgroup::

- name: modify sudo settings
run: |
sudo sed -i 's/Defaults env_reset//' /etc/sudoers

- name: Create the fixtures directory
run: |
bundle exec rake spec_prep

- name: install actual bolt
run: |
wget https://apt.puppet.com/puppet-tools-release-jammy.deb
sudo -E dpkg -i puppet-tools-release-jammy.deb
sudo -E apt-get update
sudo -E apt-get -y install puppet-bolt
sudo -E /usr/local/bin/bolt --modulepath spec/fixtures/modules plan show

- name: install pe
run: |
echo -e 'groups:\n - name: pe\n targets:\n - localhost' > inventory.yaml
sudo -E /usr/local/bin/bolt --modulepath spec/fixtures/modules plan show
sudo -E /usr/local/bin/bolt --modulepath spec/fixtures/modules plan run facts targets=localhost
sudo -E /usr/local/bin/bolt --modulepath spec/fixtures/modules plan run deploy_pe::provision_master targets=localhost version=2021.7.8

- name: run bootstrap task
run: |
curl -k https://localhost:8140/packages/current/install.bash -I
sudo -E /opt/hostedtoolcache/Ruby/2.7.8/x64/bin/bundle exec bolt --modulepath spec/fixtures/modules task run bootstrap --targets localhost master=localhost certname=testing123.com

# Integration_windows: Currently no way to test Windows agent installation.
# runs-on: windows-latest
# env:
# PUPPET_GEM_VERSION: '~> 7.24'
# FACTER_GEM_VERSION: 'https://github.com/puppetlabs/facter#main' # why is this set?


# steps:
# - name: enable long file path
# run: |
# New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
# - name: checkout source
# uses: actions/checkout@v4

# - name: Activate Ruby 3.2
# uses: ruby/setup-ruby@v1
# with:
# ruby-version: "3.2"
# bundler-cache: true
# cache-version: 1
27 changes: 27 additions & 0 deletions .github/workflows/labeller.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Labeller

on:
issues:
types:
- opened
- labeled
- unlabeled
pull_request_target:
types:
- opened
- labeled
- unlabeled

jobs:
label:
runs-on: ubuntu-latest
steps:

- uses: puppetlabs/[email protected]
name: Label issues or pull requests
with:
label_name: community
label_color: '5319e7'
org_membership: puppetlabs
fail_if_member: 'true'
token: ${{ secrets.IAC_COMMUNITY_LABELER }}
16 changes: 16 additions & 0 deletions .github/workflows/mend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: "mend"

on:
pull_request_target:
types:
- opened
- synchronize
schedule:
- cron: "0 0 * * *"
workflow_dispatch:

jobs:

mend:
uses: "puppetlabs/cat-github-actions/.github/workflows/mend_ruby.yml@main"
secrets: "inherit"
24 changes: 24 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: "nightly"

on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:

jobs:
Spec:
uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main"
with:
runs_on: "ubuntu-20.04"
secrets: "inherit"

Acceptance:
needs: Spec
uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main"
with:
runs_on: "ubuntu-20.04"
secrets: "inherit"

Integration:
needs: Spec
uses: "./.github/workflows/integration_test.yml"
28 changes: 28 additions & 0 deletions .github/workflows/pwsh_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: "pwsh_lint"

on:
pull_request:
branches:
- "main"

jobs:
pwsh_lint:
runs-on: windows-latest

steps:
- name: enable long file path
run: |
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force

- name: checkout source
uses: actions/checkout@v4

- name: install PSScriptAnalyzer
run: |
Install-Module -Name PSScriptAnalyzer -RequiredVersion 1.21.0
Get-InstalledModule

- name: pwsh lint check
run: |
Invoke-ScriptAnalyzer -Recurse -EnableExit -Path .\tasks -ReportSummary
51 changes: 7 additions & 44 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,9 @@
name: "release"

on:
push:
branches:
- 'release'
name: "Publish module"

on:
workflow_dispatch:

jobs:
LitmusAcceptance:
env:
HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6
HONEYCOMB_DATASET: litmus tests
runs-on: self-hosted
strategy:
matrix:
ruby_version: [2.5.x]
puppet_gem_version: [~> 6.0]
platform: [release_checks]
agent_family: ['puppet5', 'puppet6']

steps:
- uses: actions/checkout@v1
- name: Litmus Parallel
uses: puppetlabs/action-litmus_parallel@master
with:
platform: ${{ matrix.platform }}
agent_family: ${{ matrix.agent_family }}
Spec:
runs-on: self-hosted
strategy:
matrix:
check: [parallel_spec, 'syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop']
ruby_version: [2.5.x]
puppet_gem_version: [~> 5.0, ~> 6.0]
exclude:
- puppet_gem_version: ~> 5.0
check: 'syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop'
- ruby_version: 2.5.x
puppet_gem_version: ~> 5.0
steps:
- uses: actions/checkout@v1
- name: Spec Tests
uses: puppetlabs/action-litmus_spec@master
with:
puppet_gem_version: ${{ matrix.puppet_gem_version }}
check: ${{ matrix.check }}
release:
uses: "puppetlabs/cat-github-actions/.github/workflows/module_release.yml@main"
secrets: "inherit"
15 changes: 15 additions & 0 deletions .github/workflows/release_prep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: "Release Prep"

on:
workflow_dispatch:
inputs:
version:
description: "Module version to be released. Must be a valid semver string. (1.2.3)"
required: true

jobs:
release_prep:
uses: "puppetlabs/cat-github-actions/.github/workflows/module_release_prep.yml@main"
with:
version: "${{ github.event.inputs.version }}"
secrets: "inherit"
45 changes: 0 additions & 45 deletions .github/workflows/weekly.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/log/
/pkg/
/spec/fixtures/manifests/
/spec/fixtures/modules/
/spec/fixtures/modules/*
/tmp/
/vendor/
/convert_report.txt
Expand All @@ -25,3 +25,4 @@
.project
.envrc
/inventory.yaml
/spec/fixtures/litmus_inventory.yaml
12 changes: 7 additions & 5 deletions .pdkignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/log/
/pkg/
/spec/fixtures/manifests/
/spec/fixtures/modules/
/spec/fixtures/modules/*
/tmp/
/vendor/
/convert_report.txt
Expand All @@ -25,18 +25,20 @@
.project
.envrc
/inventory.yaml
/appveyor.yml
/spec/fixtures/litmus_inventory.yaml
/.fixtures.yml
/Gemfile
/.gitattributes
/.github/
/.gitignore
/.gitlab-ci.yml
/.pdkignore
/.puppet-lint.rc
/Rakefile
/rakelib/
/.rspec
/.rubocop.yml
/.travis.yml
/..yml
/.yardopts
/spec/
/.vscode/
/.sync.yml
/.devcontainer/
Loading
Loading