Skip to content

Commit

Permalink
Fix ami fetch when testing suse 15 (#630)
Browse files Browse the repository at this point in the history
* Fix ami fetch when testing suse 15

* Fix syntax

* Fix syntax

* Always attempt to get test files

* Fix syntax

* Fix syntax

* Fix map

* Fix map2

* Fix syntax
  • Loading branch information
Julien4218 authored Feb 2, 2022
1 parent ac6f9ad commit 76c9ca9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
27 changes: 13 additions & 14 deletions .github/workflows/validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion recipes/newrelic/infrastructure/suse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/definitions-eu/infra-agent/suse/suse152-infra.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit 76c9ca9

Please sign in to comment.