Skip to content

Commit

Permalink
Merge pull request #195 from cyberark/test-additional-versions
Browse files Browse the repository at this point in the history
Test against Ansible versions 7 and 8
  • Loading branch information
john-odonnell authored Sep 18, 2023
2 parents b1937e1 + 552bb2e commit 732dd22
Show file tree
Hide file tree
Showing 64 changed files with 609 additions and 1,213 deletions.
30 changes: 14 additions & 16 deletions .github/workflows/ansible-test.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
# This file implements a Github action to run Ansible collection sanity tests
# on the Conjur Ansible Collection. The Ansible collection sanity tests are
# run across the following matrices:
# and unit tests on the Conjur Ansible Collection. The Ansible collection tests
# are run across the following matrices:
#
# Ansible versions:
# - stable-2.13
# - stable-2.14
# - stable-2.15
# - devel
# Ansible versions (Python versions):
# - stable-2.13 (3.8, 3.9, 3.10)
# - stable-2.14 (3.9, 3.10, 3.11)
# - stable-2.15 (3.9, 3.10, 3.11)
# - devel (3.10)
#
# Python versions:
# - 3.8 (2.13)
# - 3.9 (2.13, 2.14, 2.15)
# - 3.10
# - 3.11 (2.14, 2.15)
# As Ansible's devel version is unstable, it should be considered a smoke signal
# for the next released version. Failures against the devel version should not
# be considered blocking.

name: CI
on:
Expand All @@ -23,12 +21,12 @@ on:
jobs:

###
# Sanity tests (REQUIRED)
# Sanity tests
#
# https://docs.ansible.com/ansible/latest/dev_guide/testing_sanity.html

sanity:
name: Sanity (${{ matrix.ansible }}+py${{ matrix.python }})
name: Sanity (${{ matrix.ansible }}+py${{ matrix.python }})
strategy:
# fail-fast means one failing matrix case will cancel all other
# still-incomplete cases. As tests against Ansible's devel branch are
Expand Down Expand Up @@ -68,7 +66,7 @@ jobs:
with:
python-version: ${{ matrix.python }}

# Install the head of the given branch (devel, stable-2.10)
# Install the head of the given branch
- name: Install ansible-base (${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check

Expand All @@ -80,7 +78,7 @@ jobs:
working-directory: ./ansible_collections/cyberark/conjur

###
# Unit tests (OPTIONAL)
# Unit tests
#
# https://docs.ansible.com/ansible/latest/dev_guide/testing_units.html

Expand Down
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ tests/*/coverage/
tests/*/junit/
tests/*/reports/

tests/*/conjur.pem
tests/*/conjur-enterprise.pem
tests/*/access_token
dev/conjur.pem
dev/access_token
dev/tmp

**/test-files/output
**/conjur-intro/
bot
coverage
junit
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "dev/conjur-intro"]
path = dev/conjur-intro
url = https://github.com/conjurdemos/conjur-intro
110 changes: 85 additions & 25 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,43 +36,94 @@ pipeline {

stage('Run integration tests with Conjur Open Source') {
stages {
stage('Ansible v6 - latest') {
parallel {
stage('Testing conjur_variable lookup plugin') {
stage('Ansible v8 (core 2.15) - latest') {
stages {
stage('Deploy Conjur') {
steps {
sh './ci/test.sh -d conjur_variable'
junit 'tests/conjur_variable/junit/*'
sh './dev/start.sh -v 8'
}
}

stage('Testing conjur_host_identity role') {
steps {
sh './ci/test.sh -d conjur_host_identity'
junit 'roles/conjur_host_identity/tests/junit/*'
stage('Run tests') {
parallel {
stage('Testing conjur_variable lookup plugin') {
steps {
sh './ci/test.sh -d -t conjur_variable'
junit 'tests/conjur_variable/junit/*'
}
}

stage('Testing conjur_host_identity role') {
steps {
sh './ci/test.sh -d -t conjur_host_identity'
junit 'roles/conjur_host_identity/tests/junit/*'
}
}
}
}
}
}

stage('Ansible v5') {
stage('Ansible v7 (core 2.14)') {
when {
anyOf {
branch 'main'
buildingTag()
}
}
parallel {
stage('Testing conjur_variable lookup plugin') {
stages {
stage('Deploy Conjur') {
steps {
sh './ci/test.sh -v 5 -d conjur_variable'
junit 'tests/conjur_variable/junit/*'
sh './dev/start.sh -v 7'
}
}
stage('Run tests') {
parallel {
stage('Testing conjur_variable lookup plugin') {
steps {
sh './ci/test.sh -d -t conjur_variable'
junit 'tests/conjur_variable/junit/*'
}
}

stage('Testing conjur_host_identity role') {
steps {
sh './ci/test.sh -d -t conjur_host_identity'
junit 'roles/conjur_host_identity/tests/junit/*'
}
}
}
}
}
}

stage('Testing conjur_host_identity role') {
stage('Ansible v6 (core 2.13)') {
when {
anyOf {
branch 'main'
buildingTag()
}
}
stages {
stage('Deploy Conjur') {
steps {
sh './ci/test.sh -v 5 -d conjur_host_identity'
junit 'roles/conjur_host_identity/tests/junit/*'
sh './dev/start.sh -v 6'
}
}
stage('Run tests') {
parallel {
stage('Testing conjur_variable lookup plugin') {
steps {
sh './ci/test.sh -d -t conjur_variable'
junit 'tests/conjur_variable/junit/*'
}
}

stage('Testing conjur_host_identity role') {
steps {
sh './ci/test.sh -d -t conjur_host_identity'
junit 'roles/conjur_host_identity/tests/junit/*'
}
}
}
}
}
Expand All @@ -82,17 +133,26 @@ pipeline {

stage('Run integration tests with Conjur Enterprise') {
stages {
stage("Testing conjur_variable lookup plugin") {
stage('Deploy Conjur Enterprise') {
steps {
sh './ci/test.sh -e -d conjur_variable'
junit 'tests/conjur_variable/junit/*'
sh './dev/start.sh -e -v 8'
}
}
stage('Run tests') {
parallel {
stage("Testing conjur_variable lookup plugin") {
steps {
sh './ci/test.sh -d -t conjur_variable'
junit 'tests/conjur_variable/junit/*'
}
}

stage("Testing conjur_host_identity role") {
steps {
sh './ci/test.sh -e -d conjur_host_identity'
junit 'roles/conjur_host_identity/tests/junit/*'
stage("Testing conjur_host_identity role") {
steps {
sh './ci/test.sh -d -t conjur_host_identity'
junit 'roles/conjur_host_identity/tests/junit/*'
}
}
}
}
}
Expand Down
Loading

0 comments on commit 732dd22

Please sign in to comment.