Skip to content
This repository has been archived by the owner on Jun 19, 2020. It is now read-only.

Commit

Permalink
Merge 63df33f into 9933642
Browse files Browse the repository at this point in the history
  • Loading branch information
Filipovici-Andrei committed Apr 30, 2020
2 parents 9933642 + 63df33f commit 895e6d7
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/actions/presuite.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/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 3 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
bundle info beaker --path

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

printf '\nInstall facter 4 dependencies\n\n'
cd $cwd/$FACTER_4_ROOT && bundle install

printf '\nInstall facter 4\n\n'
gem build facter.gemspec
gem install -f facter-*.gem

printf '\nBeaker tests\n\n'
cd $cwd/$FACTER_3_ROOT/acceptance
beaker exec tests/options/config_file/load_from_ruby.rb --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'}
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
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: 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: Run acceptance tests
run: |
sudo -E bash -c facter_4/.github/actions/presuite.sh
sudo chmod a+rwx /home/runner
- name: Setup tmate session
uses: mxschmitt/action-tmate@v2

0 comments on commit 895e6d7

Please sign in to comment.