This repository was archived by the owner on Jun 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
(FACT-2569) Run acceptance tests on Ubuntu GitHub actions #477
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
e7af2e0
(FACT-2569) implemented acceptance tests run in GitHub Actions
4f69d4a
Merge branch 'master' into FACT-2569
Filipovici-Andrei a2bab86
(FACT-2569) deactivate check for files with world writable permissions
873704e
Merge remote-tracking branch 'origin/FACT-2569' into FACT-2569
8c81c56
(FACT-2569) changed ruby setup
ccc20f8
(FACT-2569) skipped failing tests on ubuntu
b59a0d2
(FACT-2569) skipped failing tests on ubuntu
1cf9bf5
(FACT-2569) changed how facter is replaced
f24ec56
(FACT-2569) changed how facter is replaced
e9b8104
(FACT-2569) changed how facter is replaced
3df86f1
Merge branch 'master' into FACT-2569
3ffb366
(FACT-2569) print facter version and version in puppet facts
c0219bd
Merge branch 'master' into FACT-2569
aef8923
(FACT-2569) added missing parameter
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| #!/bin/sh -x | ||
|
|
||
| export DEBIAN_DISABLE_RUBYGEMS_INTEGRATION=no_wornings | ||
| export PATH=/opt/puppetlabs/bin/:/opt/puppetlabs/puppet/bin:$PATH | ||
|
|
||
| cwd=$(pwd) | ||
|
|
||
| printf '\nInstall bundler\n\n' | ||
| gem install bundler | ||
|
|
||
| printf '\nInstall facter 3 acceptance dependencies\n\n' | ||
| cd $cwd/$FACTER_3_ROOT/acceptance && bundle install | ||
|
|
||
| printf '\nInstall custom beaker\n\n' | ||
| cd $cwd/$BEAKER_ROOT | ||
| gem build beaker.gemspec | ||
| gem install beaker-*.gem --bindir /bin | ||
|
|
||
| printf '\nBeaker provision\n\n' | ||
| cd $cwd/$FACTER_3_ROOT/acceptance | ||
| beaker init -h ubuntu1804-64a{hypervisor=none\,hostname=localhost} -o config/aio/options.rb | ||
| beaker provision | ||
|
|
||
| printf '\nBeaker pre-suite\n\n' | ||
| BP_ROOT=`bundle info beaker-puppet --path` | ||
| beaker exec pre-suite --pre-suite $BP_ROOT/setup/aio/010_Install_Puppet_Agent.rb | ||
|
|
||
| printf '\nConfigure facter 4 as facter 3\n\n' | ||
| puppet config set facterng true | ||
|
|
||
| cd $cwd/$FACTER_4_ROOT | ||
| puppet_gem_command=/opt/puppetlabs/puppet/bin/gem | ||
| $puppet_gem_command build agent/facter-ng.gemspec | ||
| $puppet_gem_command uninstall facter-ng | ||
| $puppet_gem_command install -f facter-ng-*.gem | ||
|
|
||
| cd /opt/puppetlabs/puppet/bin | ||
| mv facter-ng facter | ||
|
|
||
| printf "\nFacter version\n\n" | ||
| facter --version | ||
|
|
||
| printf "\Puppet facts facter version\n\n" | ||
| puppet facts | grep facterversion | ||
|
|
||
| printf '\nBeaker tests\n\n' | ||
| cd $cwd/$FACTER_3_ROOT/acceptance | ||
| beaker exec tests --test-tag-exclude=server,facter_3 --test-tag-or=risk:high,audit:high 2>&1 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| --- | ||
| name: GitHub hosted facter CI | ||
|
|
||
| on: [pull_request] | ||
|
|
||
| jobs: | ||
| ci: | ||
| name: Run acceptance tests | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| FACTER_3_ROOT: facter_3 | ||
| FACTER_4_ROOT: facter_4 | ||
| BEAKER_ROOT: beaker | ||
| SHA: latest | ||
|
|
||
| steps: | ||
| - name: Checkout current PR | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| path: facter_4 | ||
|
|
||
| - name: Clone facter 3 repo | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| repository: puppetlabs/facter | ||
| ref: skip_failures_on_ng | ||
| path: facter_3 | ||
|
|
||
| - name: Clone Mihai's beaker fork | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| repository: mihaibuzgau/beaker | ||
| ref: master | ||
| path: beaker | ||
|
|
||
| - name: Install Ruby 2.6.x | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: '2.6' | ||
|
|
||
| - name: Fix permissions | ||
| run: | | ||
| sudo chmod a-w /opt /home/runner /usr/share | ||
| sudo chmod -R a-w /usr/share/rust /home/runner/.config | ||
|
|
||
| - name: Run acceptance tests | ||
| run: sudo -E bash -c facter_4/.github/actions/presuite.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.