Projet

Général

Profil

Révision 5fea281f

ID5fea281f206db238ec88d0cd9c1183a14c46181f
Parent 407adb54
Enfant fa92e118

Ajouté par Tim Stallmann il y a plus de 3 ans

modulesync 4.2.0

Voir les différences:

.editorconfig
1 1
# editorconfig.org
2 2

  
3
# MANAGED BY MODULESYNC
3
# Managed by modulesync - DO NOT EDIT
4
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
4 5

  
5 6
root = true
6 7

  
.github/CONTRIBUTING.md
25 25

  
26 26
* Fork the repo.
27 27
* Create a separate branch for your change.
28
* We only take pull requests with passing tests, and documentation. [travis-ci](http://travis-ci.org) runs the tests for us. You can also execute them locally. This is explained [in a later section](#the-test-matrix).
28
* We only take pull requests with passing tests, and documentation. [GitHub Actions](https://docs.github.com/en/actions) run the tests for us. You can also execute them locally. This is explained [in a later section](#the-test-matrix).
29 29
* Checkout [our docs](https://voxpupuli.org/docs/reviewing_pr/) we use to review a module and the [official styleguide](https://puppet.com/docs/puppet/6.0/style_guide.html). They provide some guidance for new code that might help you before you submit a pull request.
30 30
* Add a test for your change. Only refactoring and documentation changes require no new tests. If you are adding functionality or fixing a bug, please add a test.
31 31
* Squash your commits down into logical components. Make sure to rebase against our current master.
......
232 232
with:
233 233

  
234 234
```sh
235
bundle exec rake beaker
236
```
237

  
238
This will run the tests on the module's default nodeset. You can override the
239
nodeset used, e.g.,
240

  
241
```sh
242
BEAKER_set=centos-7-x64 bundle exec rake beaker
243
```
244

  
245
There are default rake tasks for the various acceptance test modules, e.g.,
246

  
247
```sh
248
bundle exec rake beaker:centos-7-x64
249
bundle exec rake beaker:ssh:centos-7-x64
250
```
251

  
252
If you don't want to have to recreate the virtual machine every time you can
253
use `BEAKER_destroy=no` and `BEAKER_provision=no`. On the first run you will at
254
least need `BEAKER_provision` set to yes (the default). The Vagrantfile for the
255
created virtual machines will be in `.vagrant/beaker_vagrant_files`.
256

  
257
Beaker also supports docker containers. We also use that in our automated CI
258
pipeline at [travis-ci](http://travis-ci.org). To use that instead of Vagrant:
259

  
260
```sh
261
PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=debian10-64{hypervisor=docker} BEAKER_destroy=yes bundle exec rake beaker
235
BEAKER_setfile=debian10-x64 bundle exec rake beaker
262 236
```
263 237

  
264 238
You can replace the string `debian10` with any common operating system.
......
272 246
* centos7
273 247
* centos8
274 248

  
275
The easiest way to debug in a docker container is to open a shell:
276

  
277
```sh
278
docker exec -it -u root ${container_id_or_name} bash
279
```
249
For more information and tips & tricks, see [voxpupuli-acceptance's documentation](https://github.com/voxpupuli/voxpupuli-acceptance#running-tests).
280 250

  
281 251
The source of this file is in our [modulesync_config](https://github.com/voxpupuli/modulesync_config/blob/master/moduleroot/.github/CONTRIBUTING.md.erb)
282 252
repository.
.github/workflows/ci.yml
1
---
2
# Managed by modulesync - DO NOT EDIT
3
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
4

  
1 5
name: CI
2 6

  
3 7
on: pull_request
4 8

  
9
concurrency:
10
  group: ${{ github.head_ref }}
11
  cancel-in-progress: true
12

  
5 13
jobs:
6 14
  setup_matrix:
7 15
    name: 'Setup Test Matrix'
8 16
    runs-on: ubuntu-latest
17
    timeout-minutes: 40
9 18
    outputs:
10
      beaker_setfiles: ${{ steps.get-outputs.outputs.beaker_setfiles }}
11
      puppet_major_versions: ${{ steps.get-outputs.outputs.puppet_major_versions }}
12 19
      puppet_unit_test_matrix: ${{ steps.get-outputs.outputs.puppet_unit_test_matrix }}
20
      github_action_test_matrix: ${{ steps.get-outputs.outputs.github_action_test_matrix }}
13 21
    env:
14
      BUNDLE_WITHOUT: development:release
22
      BUNDLE_WITHOUT: development:system_tests:release
15 23
    steps:
16 24
      - uses: actions/checkout@v2
17 25
      - name: Setup ruby
18 26
        uses: ruby/setup-ruby@v1
19 27
        with:
20
          ruby-version: '2.7'
28
          ruby-version: '3.0'
21 29
          bundler-cache: true
22
      - name: Run rake validate
23
        run: bundle exec rake validate
24
      - name: Run rake rubocop https://github.com/voxpupuli/modulesync_config/pull/690
30
      - name: Run static validations
31
        run: bundle exec rake validate lint check
32
      - name: Run rake rubocop
25 33
        run: bundle exec rake rubocop
26 34
      - name: Setup Test Matrix
27 35
        id: get-outputs
......
30 38
  unit:
31 39
    needs: setup_matrix
32 40
    runs-on: ubuntu-latest
41
    timeout-minutes: 40
33 42
    strategy:
34 43
      fail-fast: false
35 44
      matrix:
......
46 55
          ruby-version: ${{ matrix.ruby }}
47 56
          bundler-cache: true
48 57
      - name: Run tests
49
        run: bundle exec rake
58
        run: bundle exec rake parallel_spec
50 59

  
51 60
  acceptance:
52 61
    needs: setup_matrix
......
56 65
    strategy:
57 66
      fail-fast: false
58 67
      matrix:
59
        setfile: ${{fromJson(needs.setup_matrix.outputs.beaker_setfiles)}}
60
        puppet: ${{fromJson(needs.setup_matrix.outputs.puppet_major_versions)}}
68
        include: ${{fromJson(needs.setup_matrix.outputs.github_action_test_matrix)}}
61 69
    name: ${{ matrix.puppet.name }} - ${{ matrix.setfile.name }}
62 70
    steps:
63
      - name: Enable IPv6 on docker
64
        run: |
65
          echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json
66
          sudo service docker restart
67 71
      - uses: actions/checkout@v2
68 72
      - name: Setup ruby
69 73
        uses: ruby/setup-ruby@v1
70 74
        with:
71
          ruby-version: '2.7'
75
          ruby-version: '3.0'
72 76
          bundler-cache: true
73 77
      - name: Run tests
74 78
        run: bundle exec rake beaker
75 79
        env:
76 80
          BEAKER_PUPPET_COLLECTION: ${{ matrix.puppet.collection }}
77 81
          BEAKER_setfile: ${{ matrix.setfile.value }}
82

  
83
  tests:
84
    needs:
85
      - unit
86
      - acceptance
87
    runs-on: ubuntu-latest
88
    name: Test suite
89
    steps:
90
      - run: echo Test suite completed
.github/workflows/release.yml
1
---
2
# Managed by modulesync - DO NOT EDIT
3
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
4

  
1 5
name: Release
2 6

  
3 7
on:
......
12 16
  deploy:
13 17
    name: 'deploy to forge'
14 18
    runs-on: ubuntu-latest
19
    if: github.repository_owner == 'voxpupuli'
15 20
    steps:
16 21
      - name: Checkout repository
17 22
        uses: actions/checkout@v2
.gitignore
1
# Managed by modulesync - DO NOT EDIT
2
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
3

  
1 4
pkg/
2 5
Gemfile.lock
3 6
Gemfile.local
.msync.yml
1 1
---
2
modulesync_config_version: '4.0.0'
2
# Managed by modulesync - DO NOT EDIT
3
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
4

  
5
modulesync_config_version: '4.2.0'
.overcommit.yml
1
# Managed by https://github.com/voxpupuli/modulesync_configs
1
# Managed by modulesync - DO NOT EDIT
2
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
2 3
#
3 4
# Hooks are only enabled if you take action.
4 5
#
.pmtignore
1
# Managed by modulesync - DO NOT EDIT
2
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
3

  
1 4
docs/
2 5
pkg/
3 6
Gemfile
.rspec
1
# Managed by modulesync - DO NOT EDIT
2
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
3

  
1 4
--format documentation
2 5
--color
.rspec_parallel
1
# Managed by modulesync - DO NOT EDIT
2
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
3

  
1 4
--format progress
.rubocop.yml
1 1
---
2
# Managed by modulesync - DO NOT EDIT
3
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
4

  
2 5
inherit_gem:
3 6
  voxpupuli-test: rubocop.yml
4

  
5
# Remove once released
6
# https://github.com/voxpupuli/voxpupuli-test/pull/36
7
Style/TrailingCommaInArguments:
8
  Enabled: False
.yardopts
1
--markup markdown
2
--output-dir docs/
Dockerfile
1
FROM ruby:2.5.3
1
# MANAGED BY MODULESYNC
2
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
3

  
4
FROM ruby:2.7
2 5

  
3 6
WORKDIR /opt/puppet
4 7

  
Gemfile
1
# Managed by modulesync - DO NOT EDIT
2
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
3

  
1 4
source ENV['GEM_SOURCE'] || "https://rubygems.org"
2 5

  
3 6
group :test do
4
  gem 'voxpupuli-test', '~> 2.1',  :require => false
5
  gem 'coveralls',                 :require => false
6
  gem 'simplecov-console',         :require => false
7
  gem 'puppet-lint-param-docs',    :require => false
7
  gem 'voxpupuli-test', '~> 2.5',   :require => false
8
  gem 'coveralls',                  :require => false
9
  gem 'simplecov-console',          :require => false
10
  gem 'puppet_metadata', '~> 1.0',  :require => false
11
  gem 'puppet-lint-param-docs',     :require => false
8 12
end
9 13

  
10 14
group :development do
......
13 17
end
14 18

  
15 19
group :system_tests do
16
  gem 'puppet_metadata', '~> 0.3.0',  :require => false
17
  gem 'voxpupuli-acceptance',         :require => false
20
  gem 'voxpupuli-acceptance', '~> 1.0',  :require => false
18 21
end
19 22

  
20 23
group :release do
21
  gem 'github_changelog_generator',  :require => false, :git => 'https://github.com/voxpupuli/github-changelog-generator', :branch => 'voxpupuli_essential_fixes'
22
  gem 'puppet-blacksmith',           :require => false
23
  gem 'voxpupuli-release',           :require => false
24
  gem 'puppet-strings', '>= 2.2',    :require => false
24
  gem 'github_changelog_generator', '>= 1.16.1',  :require => false if RUBY_VERSION >= '2.5'
25
  gem 'voxpupuli-release', '>= 1.0.2',            :require => false
26
  gem 'puppet-strings', '>= 2.2',                 :require => false
25 27
end
26 28

  
27
gem 'puppetlabs_spec_helper', '~> 2.0', :require => false
28 29
gem 'rake', :require => false
29 30
gem 'facter', ENV['FACTER_GEM_VERSION'], :require => false, :groups => [:test]
30 31

  
31
puppetversion = ENV['PUPPET_VERSION'] || '~> 6.0'
32
puppetversion = ENV['PUPPET_VERSION'] || '>= 6.0'
32 33
gem 'puppet', puppetversion, :require => false, :groups => [:test]
33 34

  
34 35
# vim: syntax=ruby
Rakefile
1
# Managed by modulesync - DO NOT EDIT
2
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
3

  
1 4
# Attempt to load voxupuli-test (which pulls in puppetlabs_spec_helper),
2 5
# otherwise attempt to load it directly.
3 6
begin
4 7
  require 'voxpupuli/test/rake'
5 8
rescue LoadError
6
  require 'puppetlabs_spec_helper/rake_tasks'
9
  begin
10
    require 'puppetlabs_spec_helper/rake_tasks'
11
  rescue LoadError
12
  end
13
end
14

  
15
# load optional tasks for acceptance
16
# only available if gem group releases is installed
17
begin
18
  require 'voxpupuli/acceptance/rake'
19
rescue LoadError
7 20
end
8 21

  
9 22
# load optional tasks for releases
......
34 47
  require 'github_changelog_generator/task'
35 48
  require 'puppet_blacksmith'
36 49
  GitHubChangelogGenerator::RakeTask.new :changelog do |config|
37
    version = (Blacksmith::Modulefile.new).version
38
    config.future_release = "v#{version}" if version =~ /^\d+\.\d+.\d+$/
50
    metadata = Blacksmith::Modulefile.new
51
    config.future_release = "v#{metadata.version}" if metadata.version =~ /^\d+\.\d+.\d+$/
39 52
    config.header = "# Changelog\n\nAll notable changes to this project will be documented in this file.\nEach new release typically also includes the latest modulesync defaults.\nThese should not affect the functionality of the module."
40 53
    config.exclude_labels = %w{duplicate question invalid wontfix wont-fix modulesync skip-changelog}
41 54
    config.user = 'voxpupuli'
42
    metadata_json = File.join(File.dirname(__FILE__), 'metadata.json')
43
    metadata = JSON.load(File.read(metadata_json))
44
    config.project = metadata['name']
55
    config.project = metadata.metadata['name']
45 56
  end
46 57

  
47 58
  # Workaround for https://github.com/github-changelog-generator/github-changelog-generator/issues/715
spec/spec_helper.rb
1
# This file is managed via modulesync
2
# https://github.com/voxpupuli/modulesync
3
# https://github.com/voxpupuli/modulesync_config
1
# Managed by modulesync - DO NOT EDIT
2
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
4 3

  
5 4
RSpec.configure do |c|
6 5
  c.mock_with :mocha
spec/spec_helper_acceptance.rb
1
# This file is completely managed via modulesync
1
# Managed by modulesync - DO NOT EDIT
2
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
3

  
2 4
require 'voxpupuli/acceptance/spec_helper_acceptance'
3 5

  
4 6
configure_beaker

Formats disponibles : Unified diff