From c1da0b15fbe97485b6438289496a388c5df006c1 Mon Sep 17 00:00:00 2001 From: Wayne Warren Date: Sun, 31 Dec 2017 13:19:01 -0600 Subject: [PATCH] Add tests for inner macro expansion. Change-Id: I535f3f0627c0948b951074977e15be04920790cd --- ...itional-step_inner-macro-expansion-001.xml | 31 +++++++++++++ ...tional-step_inner-macro-expansion-001.yaml | 19 ++++++++ ...al-publisher_inner-macro-expansion-001.xml | 36 +++++++++++++++ ...l-publisher_inner-macro-expansion-001.yaml | 19 ++++++++ ...tbuildscript_inner-macro-expansion-001.xml | 29 ++++++++++++ ...buildscript_inner-macro-expansion-001.yaml | 17 +++++++ .../release_inner-macro-expansion-001.xml | 45 +++++++++++++++++++ .../release_inner-macro-expansion-001.yaml | 34 ++++++++++++++ 8 files changed, 230 insertions(+) create mode 100644 tests/macros/fixtures/builder/conditional-step_inner-macro-expansion-001.xml create mode 100644 tests/macros/fixtures/builder/conditional-step_inner-macro-expansion-001.yaml create mode 100644 tests/macros/fixtures/publisher/conditional-publisher_inner-macro-expansion-001.xml create mode 100644 tests/macros/fixtures/publisher/conditional-publisher_inner-macro-expansion-001.yaml create mode 100644 tests/macros/fixtures/publisher/postbuildscript_inner-macro-expansion-001.xml create mode 100644 tests/macros/fixtures/publisher/postbuildscript_inner-macro-expansion-001.yaml create mode 100644 tests/macros/fixtures/wrapper/release_inner-macro-expansion-001.xml create mode 100644 tests/macros/fixtures/wrapper/release_inner-macro-expansion-001.yaml diff --git a/tests/macros/fixtures/builder/conditional-step_inner-macro-expansion-001.xml b/tests/macros/fixtures/builder/conditional-step_inner-macro-expansion-001.xml new file mode 100644 index 000000000..3b7bb680d --- /dev/null +++ b/tests/macros/fixtures/builder/conditional-step_inner-macro-expansion-001.xml @@ -0,0 +1,31 @@ + + + + <!-- Managed by Jenkins Job Builder --> + false + false + false + false + true + + + + + + + fine + + + + + + + filename + + + + + + + + diff --git a/tests/macros/fixtures/builder/conditional-step_inner-macro-expansion-001.yaml b/tests/macros/fixtures/builder/conditional-step_inner-macro-expansion-001.yaml new file mode 100644 index 000000000..3411cc4f0 --- /dev/null +++ b/tests/macros/fixtures/builder/conditional-step_inner-macro-expansion-001.yaml @@ -0,0 +1,19 @@ +- builder: + name: Macro + builders: + - shell: "" + +- job: + name: Job + builders: + - conditional-step: + condition-kind: file-exists + condition-filename: 'filename' + steps: + - shell: "fine" + - Macro + +- project: + name: meow + jobs: + - Job diff --git a/tests/macros/fixtures/publisher/conditional-publisher_inner-macro-expansion-001.xml b/tests/macros/fixtures/publisher/conditional-publisher_inner-macro-expansion-001.xml new file mode 100644 index 000000000..894f22d74 --- /dev/null +++ b/tests/macros/fixtures/publisher/conditional-publisher_inner-macro-expansion-001.xml @@ -0,0 +1,36 @@ + + + + <!-- Managed by Jenkins Job Builder --> + false + false + false + false + true + + + + + + + + + filename + + + + + + true + true + + + + + + + + + + + diff --git a/tests/macros/fixtures/publisher/conditional-publisher_inner-macro-expansion-001.yaml b/tests/macros/fixtures/publisher/conditional-publisher_inner-macro-expansion-001.yaml new file mode 100644 index 000000000..7e966736b --- /dev/null +++ b/tests/macros/fixtures/publisher/conditional-publisher_inner-macro-expansion-001.yaml @@ -0,0 +1,19 @@ +- publisher: + name: Macro + publishers: + - chuck-norris + +- job: + name: Job + publishers: + - conditional-publisher: + - condition-kind: file-exists + condition-filename: 'filename' + action: + - build-publisher + - Macro + +- project: + name: meow + jobs: + - Job diff --git a/tests/macros/fixtures/publisher/postbuildscript_inner-macro-expansion-001.xml b/tests/macros/fixtures/publisher/postbuildscript_inner-macro-expansion-001.xml new file mode 100644 index 000000000..2199994f0 --- /dev/null +++ b/tests/macros/fixtures/publisher/postbuildscript_inner-macro-expansion-001.xml @@ -0,0 +1,29 @@ + + + + <!-- Managed by Jenkins Job Builder --> + false + false + false + false + true + + + + + + + + fine + + + + + + true + false + false + + + + diff --git a/tests/macros/fixtures/publisher/postbuildscript_inner-macro-expansion-001.yaml b/tests/macros/fixtures/publisher/postbuildscript_inner-macro-expansion-001.yaml new file mode 100644 index 000000000..7fa2eaaf6 --- /dev/null +++ b/tests/macros/fixtures/publisher/postbuildscript_inner-macro-expansion-001.yaml @@ -0,0 +1,17 @@ +- builder: + name: Macro + builders: + - shell: "" + +- job: + name: Job + publishers: + - postbuildscript: + builders: + - shell: "fine" + - Macro + +- project: + name: meow + jobs: + - Job diff --git a/tests/macros/fixtures/wrapper/release_inner-macro-expansion-001.xml b/tests/macros/fixtures/wrapper/release_inner-macro-expansion-001.xml new file mode 100644 index 000000000..f6fe354e7 --- /dev/null +++ b/tests/macros/fixtures/wrapper/release_inner-macro-expansion-001.xml @@ -0,0 +1,45 @@ + + + + <!-- Managed by Jenkins Job Builder --> + false + false + false + false + true + + + + + + + true + false + + + + RELEASE_BRANCH + Git branch to release from. + + + + FOO + A parameter named FOO, defaults to 'false'. + false + + + + + + + + + + #!/bin/bash +copy_build_artefacts.sh + + + + + + diff --git a/tests/macros/fixtures/wrapper/release_inner-macro-expansion-001.yaml b/tests/macros/fixtures/wrapper/release_inner-macro-expansion-001.yaml new file mode 100644 index 000000000..a32164700 --- /dev/null +++ b/tests/macros/fixtures/wrapper/release_inner-macro-expansion-001.yaml @@ -0,0 +1,34 @@ +- builder: + name: builder-macro-1 + builders: + - shell: "" + +- parameter: + name: parameter-macro-1 + parameters: + - string: + name: RELEASE_BRANCH + default: '' + description: Git branch to release from. + +- job: + name: Job + wrappers: + - release: + keep-forever: false + parameters: + - parameter-macro-1 + - bool: + name: FOO + default: false + description: "A parameter named FOO, defaults to 'false'." + post-success: + - builder-macro-1 + - shell: | + #!/bin/bash + copy_build_artefacts.sh + +- project: + name: meow + jobs: + - Job