This repository has been archived by the owner on Jun 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,44 @@ | ||
#!/bin/sh -x | ||
|
||
export DEBIAN_DISABLE_RUBYGEMS_INTEGRATION=no_wornings | ||
export PATH=/opt/puppetlabs/puppet/bin/:/opt/puppetlabs/bin:$PATH | ||
cwd=$(pwd) | ||
|
||
printf '\nInstall bundler\n\n' | ||
gem install bundler | ||
|
||
printf '\nInstall facter 4 dependencies\n\n' | ||
cd $cwd/$FACTER_4_ROOT && bundle install | ||
|
||
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 | ||
|
||
agent_facter_ng_version=`facter-ng --version | tr -d '\r'` | ||
|
||
cp -r $cwd/$FACTER_4_ROOT/* /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/facter-ng-$agent_facter_ng_version/ | ||
mv /opt/puppetlabs/puppet/bin/facter-ng /opt/puppetlabs/bin/facter | ||
|
||
puts facter -version | ||
puts 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 | tee results.txt | ||
sed -n '/Failed Tests Cases:/,/Skipped Tests Cases:/p' results.txt | grep 'Test Case' | awk {'print $3'} |
This file contains 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,45 @@ | ||
--- | ||
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: run_tests_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 | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: '2.6' | ||
|
||
- name: Fix permissions | ||
run: sudo chmod a-w /home/runner /usr/share /opt /usr/share/rust | ||
|
||
- name: Run acceptance tests | ||
run: sudo -E bash -c facter_4/.github/actions/presuite.sh |