diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index 07b6a9950..f58a5db41 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -85,7 +85,6 @@ jobs: # 2) Use javascript action / yq to pull the test definition file from the recipe yaml - name: Get Test Definition Files id: get-test-definition-files - if: env.RECIPES != '' || env.TEST_DEFINITIONS != '' uses: actions/github-script@v3 with: script: | @@ -107,24 +106,24 @@ jobs: var outputTestFiles = [] - if (env.TEST_DEFINITIONS != '') { + if (process.env.TEST_DEFINITIONS != '') { // Get incoming added/updated test definitions files - const testDefinitionFiles = process.env.TEST_DEFINITIONS ? process.env.TEST_DEFINITIONS.split(' ') : null + const testDefinitionFiles = process.env.TEST_DEFINITIONS ? process.env.TEST_DEFINITIONS.split(' ') : [] console.log(`Detected Test Definitions Files: ${JSON.stringify(testDefinitionFiles, null, 2)}`) testDefinitionFiles.forEach(testDefinitionFile => { - if (!outputTestFiles.includes(testDefinitionFile) { + if (!outputTestFiles.includes(testDefinitionFile)) { outputTestFiles.push(testDefinitionFile) } }) } - if (env.RECIPES != '') { + if (process.env.RECIPES != '') { // Get incoming added/updated recipe files - const recipeFiles = process.env.RECIPES ? process.env.RECIPES.split(' ') : null + const recipeFiles = process.env.RECIPES ? process.env.RECIPES.split(' ') : [] console.log(`Detected Recipe Files: ${JSON.stringify(recipeFiles, null, 2)}`) - if (recipeFiles) { + if (recipeFiles.length) { // Get all deploy config files const deployConfigs = await getFiles('test/definitions'); console.log("All deployConfigs:", deployConfigs); @@ -152,19 +151,19 @@ jobs: }, []); console.log('testDefinitionFilesToRun:', testDefinitionFilesToRun); - const testDefinitionFiles = testDefinitionFilesToRun.map(testDefinitionFile => { - return { testDefinitionFile } - }); - - testDefinitionFiles.forEach(testDefinitionFile => { - if (!outputTestFiles.includes(testDefinitionFile) { + testDefinitionFilesToRun.forEach(testDefinitionFile => { + if (!outputTestFiles.includes(testDefinitionFile)) { outputTestFiles.push(testDefinitionFile) } }) } } + + const outputTestFilesMap = outputTestFiles.map(testDefinitionFile => { + return { testDefinitionFile } + }) const output = { - "include": outputTestFiles + "include": outputTestFilesMap } console.log("Output: ", output); return output; diff --git a/recipes/newrelic/infrastructure/suse.yml b/recipes/newrelic/infrastructure/suse.yml index cee168fc6..fae7eb521 100644 --- a/recipes/newrelic/infrastructure/suse.yml +++ b/recipes/newrelic/infrastructure/suse.yml @@ -155,7 +155,6 @@ install: - sudo zypper -n --quiet ref -r newrelic-infra - sudo zypper -n --quiet install newrelic-infra - rm newrelic-infra.gpg - vars: SLES_VERSION: sh: awk -F= '/VERSION_ID/ {print $2}' /etc/os-release diff --git a/test/definitions-eu/infra-agent/suse/suse152-infra.json b/test/definitions-eu/infra-agent/suse/suse152-infra.json index 40e2168f1..fd0968d29 100644 --- a/test/definitions-eu/infra-agent/suse/suse152-infra.json +++ b/test/definitions-eu/infra-agent/suse/suse152-infra.json @@ -12,7 +12,7 @@ "provider": "aws", "type": "ec2", "size": "t3.micro", - "ami_name": "suse-sles-15-sp2-*" + "ami_name": "suse-sles-15-sp2-byos-v????????-hvm-ssd-x86_64" }], "instrumentations": {