Skip to content

Commit

Permalink
Merge pull request #95 from mbloch1986/feature/improve_testing
Browse files Browse the repository at this point in the history
Improving test pipeliness
  • Loading branch information
mbloch1986 authored Aug 18, 2022
2 parents 491e06c + b173911 commit d694e4e
Show file tree
Hide file tree
Showing 17 changed files with 1,727 additions and 1,394 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased
### Added
- Added new Pipeline to run security test for Full-Set & Consolidated
- Added new parameter to operational task test-aem-security pipeline to inject AEM Host to test via input parameters

### Changed
- Reorganised Full-Set/Consolidated Platform Testing pipeline so they trigger the existing pipelines for the testing
- Reorganised Full-Set Blue/Green Testing pipeline so they trigger the existing pipelines for the testing
- Reorganised Full-Set Recovery Testing pipeline so they trigger the existing pipelines for the testing
- Reorganised Full-Set Author Standby Testing pipeline so they trigger the existing pipelines for the testing
- Improved readability of operational task test-acceptance by separating each acceptance test into an own stage

### Fixed
- Fixed Green stack creation in Blue/Green Testing pipeline to use the offline-snapshots from the Blue stack for stack creation #57

## 5.12.0 - 2022-08-16
### Changed
Expand Down
96 changes: 96 additions & 0 deletions provisioners/ansible/playbooks/includes/testing-gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,26 @@
set_fact:
testing_platform_consolidated_jobs_trimmed: "{{ testing_platform_consolidated_jobs | trim_skipped() }}"

- name: Create a list of security full-set testing jobs for AWS
shell: echo {{ item.path }}
with_filetree: ../../../provisioners/jenkins/jenkinsfiles/aem-opencloud/testing/aws/
when: item.state == 'file' and item.path is match('.*full-set-security')
register: testing_security_full_set_jobs

- name: Trim skipped security full-set testing jobs for AWS
set_fact:
testing_security_full_set_jobs_trimmed: "{{ testing_security_full_set_jobs | trim_skipped() }}"

- name: Create a list of security consolidated testing jobs for AWS
shell: echo {{ item.path }}
with_filetree: ../../../provisioners/jenkins/jenkinsfiles/aem-opencloud/testing/aws/
when: item.state == 'file' and item.path is match('.*consolidated-security')
register: testing_security_consolidated_jobs

- name: Trim skipped security consolidated testing jobs for AWS
set_fact:
testing_security_consolidated_jobs_trimmed: "{{ testing_security_consolidated_jobs | trim_skipped() }}"

- name: Create a list of promote author standby full-set testing jobs for AWS
shell: echo {{ item.path }}
with_filetree: ../../../provisioners/jenkins/jenkinsfiles/aem-opencloud/testing/aws/
Expand Down Expand Up @@ -102,6 +122,30 @@
- "{{ aem_test_suite_profiles_trimmed.results }}"
- "{{ aem_aws_stack_builder_aem_stack_manager_profiles_trimmed.results }}"

- name: "Generate jobs for security full-set testing configuration profile directories"
file:
path: ../../../stage/jenkins/jobs/aem-opencloud-{{ aem_opencloud.version }}/testing/aws/{{ item[0].item.path }}-{{ item[2].item.path }}-{{ item[3].item.path }}-{{ item[4].item.path }}/{{ item[1].item.path }}/
state: directory
mode: '0776'
with_nested:
- "{{ aem_aws_stack_builder_aem_full_set_profiles_trimmed.results }}"
- "{{ testing_security_full_set_jobs_trimmed.results }}"
- "{{ aem_stack_manager_messenger_profiles_trimmed.results }}"
- "{{ aem_test_suite_profiles_trimmed.results }}"
- "{{ aem_aws_stack_builder_aem_stack_manager_profiles_trimmed.results }}"

- name: "Generate jobs for security consolidated testing configuration profile directories"
file:
path: ../../../stage/jenkins/jobs/aem-opencloud-{{ aem_opencloud.version }}/testing/aws/{{ item[0].item.path }}-{{ item[2].item.path }}-{{ item[3].item.path }}-{{ item[4].item.path }}/{{ item[1].item.path }}/
state: directory
mode: '0776'
with_nested:
- "{{ aem_aws_stack_builder_aem_consolidated_profiles_trimmed.results }}"
- "{{ testing_security_consolidated_jobs_trimmed.results }}"
- "{{ aem_stack_manager_messenger_profiles_trimmed.results }}"
- "{{ aem_test_suite_profiles_trimmed.results }}"
- "{{ aem_aws_stack_builder_aem_stack_manager_profiles_trimmed.results }}"

- name: "Generate jobs for promote author standby full-set testing configuration profile directories"
file:
path: ../../../stage/jenkins/jobs/aem-opencloud-{{ aem_opencloud.version }}/testing/aws/{{ item[0].item.path }}-{{ item[2].item.path }}-{{ item[3].item.path }}-{{ item[4].item.path }}/{{ item[1].item.path }}/
Expand Down Expand Up @@ -162,6 +206,30 @@
- "{{ aem_test_suite_profiles_trimmed.results }}"
- "{{ aem_aws_stack_builder_aem_stack_manager_profiles_trimmed.results }}"

- name: "Generate jobs for security full-set testing configuration config.xml"
template:
src: '../../../templates/ansible/jenkins/config/category-config-profile.xml.j2'
dest: ../../../stage/jenkins/jobs/aem-opencloud-{{ aem_opencloud.version }}/testing/aws/{{ item[0].item.path }}-{{ item[2].item.path }}-{{ item[3].item.path }}-{{ item[4].item.path }}/config.xml
mode: '0644'
with_nested:
- "{{ aem_aws_stack_builder_aem_full_set_profiles_trimmed.results }}"
- "{{ testing_security_full_set_jobs_trimmed.results }}"
- "{{ aem_stack_manager_messenger_profiles_trimmed.results }}"
- "{{ aem_test_suite_profiles_trimmed.results }}"
- "{{ aem_aws_stack_builder_aem_stack_manager_profiles_trimmed.results }}"

- name: "Generate jobs for security consolidated testing configuration config.xml"
template:
src: '../../../templates/ansible/jenkins/config/category-config-profile.xml.j2'
dest: ../../../stage/jenkins/jobs/aem-opencloud-{{ aem_opencloud.version }}/testing/aws/{{ item[0].item.path }}-{{ item[2].item.path }}-{{ item[3].item.path }}-{{ item[4].item.path }}/config.xml
mode: '0644'
with_nested:
- "{{ aem_aws_stack_builder_aem_consolidated_profiles_trimmed.results }}"
- "{{ testing_security_consolidated_jobs_trimmed.results }}"
- "{{ aem_stack_manager_messenger_profiles_trimmed.results }}"
- "{{ aem_test_suite_profiles_trimmed.results }}"
- "{{ aem_aws_stack_builder_aem_stack_manager_profiles_trimmed.results }}"

- name: "Generate jobs for promote author standby full-set testing configuration config.xml"
template:
src: '../../../templates/ansible/jenkins/config/category-config-profile.xml.j2'
Expand Down Expand Up @@ -230,6 +298,34 @@
- "{{ aem_test_suite_profiles_trimmed.results }}"
- "{{ aem_aws_stack_builder_aem_stack_manager_profiles_trimmed.results }}"

- name: "Generate jobs for security full-set testing config.xml"
vars:
aem_architecture_type: "{{ 'consolidated' if item[1].stdout is match('.*consolidated*') else 'full-set' }}"
template:
src: ../../../templates/ansible/jenkins/config/jobs-testing-security.xml.j2
dest: ../../../stage/jenkins/jobs/aem-opencloud-{{ aem_opencloud.version }}/testing/aws/{{ item[0].item.path }}-{{ item[2].item.path }}-{{ item[3].item.path }}-{{ item[4].item.path }}/{{ item[1].item.path }}/config.xml
mode: '0644'
with_nested:
- "{{ aem_aws_stack_builder_aem_full_set_profiles_trimmed.results }}"
- "{{ testing_security_full_set_jobs_trimmed.results }}"
- "{{ aem_stack_manager_messenger_profiles_trimmed.results }}"
- "{{ aem_test_suite_profiles_trimmed.results }}"
- "{{ aem_aws_stack_builder_aem_stack_manager_profiles_trimmed.results }}"

- name: "Generate jobs for security consolidated testing config.xml"
vars:
aem_architecture_type: "{{ 'consolidated' if item[1].stdout is match('.*consolidated*') else 'full-set' }}"
template:
src: ../../../templates/ansible/jenkins/config/jobs-testing-consolidated-security.xml.j2
dest: ../../../stage/jenkins/jobs/aem-opencloud-{{ aem_opencloud.version }}/testing/aws/{{ item[0].item.path }}-{{ item[2].item.path }}-{{ item[3].item.path }}-{{ item[4].item.path }}/{{ item[1].item.path }}/config.xml
mode: '0644'
with_nested:
- "{{ aem_aws_stack_builder_aem_consolidated_profiles_trimmed.results }}"
- "{{ testing_security_consolidated_jobs_trimmed.results }}"
- "{{ aem_stack_manager_messenger_profiles_trimmed.results }}"
- "{{ aem_test_suite_profiles_trimmed.results }}"
- "{{ aem_aws_stack_builder_aem_stack_manager_profiles_trimmed.results }}"

- name: "Generate jobs for promote author standby full-set testing config.xml"
vars:
aem_architecture_type: "{{ 'consolidated' if item[1].stdout is match('.*consolidated*') else 'full-set' }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pipeline {
steps {
JenkinsStagePreStep this

ExecCommand(this, env.TMPDIR, "aem-aws-stack-builder", "make switch-dns-consolidated config_path=${env.AOC_CONFIG_DIR}/aem-aws-stack-builder/${params.AOC_CONFIG_PROFILE_AEM_AWS_STACK_BUILDER}/ stack_prefix=${params.STACK_PREFIX} author_publish_dispatcher_hosted_zone=${AUTHOR_PUBLISH_DISPATCHER_HOSTED_ZONE} author_publish_dispatcher_record_set=${AUTHOR_PUBLISH_DISPATCHER_RECORD_SET}")
ExecCommand(this, env.TMPDIR, "aem-aws-stack-builder", "make switch-dns-consolidated config_path=${env.AOC_CONFIG_DIR}/aem-aws-stack-builder/${params.AOC_CONFIG_PROFILE_AEM_AWS_STACK_BUILDER}/ stack_prefix=${params.STACK_PREFIX} author_publish_dispatcher_hosted_zone=${params.AUTHOR_PUBLISH_DISPATCHER_HOSTED_ZONE} author_publish_dispatcher_record_set=${params.AUTHOR_PUBLISH_DISPATCHER_RECORD_SET}")
}
post {
always {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,87 @@ pipeline {
}
}
}
stage('Run acceptance tests') {
stage('Prepare configuration') {
steps {
JenkinsStagePreStep this
ExecCommand(this, env.TMPDIR, "aem-test-suite", "make config-aem-aws config_path=${env.AOC_CONFIG_PROFILE_DIR_AEM_TEST_SUITE}")
}
post {
always {
JenkinsStagePostStep this
}
}
}
stage('Architecture') {
steps {
JenkinsStagePreStep this
ExecCommand(this, env.TMPDIR, "aem-test-suite", "make test-acceptance-architecture-${params.AEM_ARCHITECTURE} config_path=${env.AOC_CONFIG_PROFILE_DIR_AEM_TEST_SUITE} stack_prefix=${params.STACK_PREFIX}")
}
post {
always {
JenkinsStagePostStep this
}
}
}
stage('Author-Primary') {
steps {
JenkinsStagePreStep this
ExecCommand(this, env.TMPDIR, "aem-test-suite", "make test-acceptance-author-primary config_path=${env.AOC_CONFIG_PROFILE_DIR_AEM_TEST_SUITE} stack_prefix=${params.STACK_PREFIX}")
}
post {
always {
JenkinsStagePostStep this
}
}
}
stage('Author-Standby') {
steps {
JenkinsStagePreStep this
ExecCommand(this, env.TMPDIR, "aem-test-suite", "make test-acceptance-author-standby config_path=${env.AOC_CONFIG_PROFILE_DIR_AEM_TEST_SUITE} stack_prefix=${params.STACK_PREFIX}")
}
post {
always {
JenkinsStagePostStep this
}
}
}
stage('Publish') {
steps {
JenkinsStagePreStep this
ExecCommand(this, env.TMPDIR, "aem-test-suite", "make test-acceptance-publish config_path=${env.AOC_CONFIG_PROFILE_DIR_AEM_TEST_SUITE} stack_prefix=${params.STACK_PREFIX}")
}
post {
always {
JenkinsStagePostStep this
}
}
}
stage('Author-Dispatcher') {
steps {
JenkinsStagePreStep this
ExecCommand(this, env.TMPDIR, "aem-test-suite", "make test-acceptance-author-dispatcher config_path=${env.AOC_CONFIG_PROFILE_DIR_AEM_TEST_SUITE} stack_prefix=${params.STACK_PREFIX}")
}
post {
always {
JenkinsStagePostStep this
}
}
}
stage('Publish-Dispatcher') {
steps {
JenkinsStagePreStep this
ExecCommand(this, env.TMPDIR, "aem-test-suite", "make test-acceptance-publish-dispatcher config_path=${env.AOC_CONFIG_PROFILE_DIR_AEM_TEST_SUITE} stack_prefix=${params.STACK_PREFIX}")
}
post {
always {
JenkinsStagePostStep this
}
}
}
stage('Orchestrator') {
steps {
JenkinsStagePreStep this
ExecCommand(this, env.TMPDIR, "aem-test-suite", "make test-acceptance-${params.AEM_ARCHITECTURE} config_path=${env.AOC_CONFIG_PROFILE_DIR_AEM_TEST_SUITE} stack_prefix=${params.STACK_PREFIX}")
ExecCommand(this, env.TMPDIR, "aem-test-suite", "make test-acceptance-orchestrator config_path=${env.AOC_CONFIG_PROFILE_DIR_AEM_TEST_SUITE} stack_prefix=${params.STACK_PREFIX}")
}
post {
always {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ pipeline {
TMPDIR = "/tmp/shinesolutions/aem-opencloud-manager"
AOC_CONFIG_DIR = "${env.TMPDIR}/aem-opencloud-config"
AOC_CONFIG_PROFILE_DIR_AEM_TEST_SUITE = "${env.AOC_CONFIG_DIR}/aem-test-suite/${params.AOC_CONFIG_PROFILE_AEM_TEST_SUITE}/"

}
parameters {
string(name: 'AOC_VERSION_AEM_TEST_SUITE', defaultValue: config.library.aem_test_suite, description: 'Version of aem-test-suite repo to archive')
string(name: 'AEM_HOST', defaultValue: '', description: '(Optional) DNS Name of the AEM Host to run the test against, e.g. author.aemopencloud.cms')
}
stages {
stage('Initialise pipeline') {
Expand Down Expand Up @@ -69,6 +69,11 @@ pipeline {
}
stage('Run Security test') {
steps {
script {
if (!params.AEM_HOST.isEmpty()) {
env.aem_host = params.AEM_HOST
}
}
JenkinsStagePreStep this
ExecCommand(this, env.TMPDIR, "aem-test-suite", "make test-security-${params.AEM_SECURITY_TEST_PLAN} stack_prefix=${params.STACK_PREFIX}")
}
Expand Down
Loading

0 comments on commit d694e4e

Please sign in to comment.