diff --git a/.automation/clean-code-base-for-tests.sh b/.automation/clean-code-base-for-tests.sh index 966f798c..a2372ce9 100755 --- a/.automation/clean-code-base-for-tests.sh +++ b/.automation/clean-code-base-for-tests.sh @@ -7,11 +7,11 @@ ########### # Globals # ########### -GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace -GITHUB_SHA="${GITHUB_SHA}" # Sha used to create this branch -TEST_FOLDER='.automation/test' # Folder where test are stored -CLEAN_FOLDER='.automation/automation' # Folder to rename to prevent skip -(( LOG_TRACE=LOG_DEBUG=LOG_VERBOSE=LOG_NOTICE=LOG_WARN=LOG_ERROR="true" )) # Enable all loging +GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace +GITHUB_SHA="${GITHUB_SHA}" # Sha used to create this branch +TEST_FOLDER='.automation/test' # Folder where test are stored +CLEAN_FOLDER='.automation/automation' # Folder to rename to prevent skip +((LOG_TRACE = LOG_DEBUG = LOG_VERBOSE = LOG_NOTICE = LOG_WARN = LOG_ERROR = "true")) # Enable all loging export LOG_TRACE LOG_DEBUG LOG_VERBOSE LOG_NOTICE LOG_WARN LOG_ERROR ############################ @@ -39,7 +39,10 @@ CleanTestFiles() { ################## # Find the files # ################## - mapfile -t FIND_CMD < <(cd "${GITHUB_WORKSPACE}" || exit 1 ; find "${GITHUB_WORKSPACE}" -type f -name "*_bad_*" 2>&1) + mapfile -t FIND_CMD < <( + cd "${GITHUB_WORKSPACE}" || exit 1 + find "${GITHUB_WORKSPACE}" -type f -name "*_bad_*" 2>&1 + ) ####################### # Load the error code # @@ -70,7 +73,10 @@ CleanTestFiles() { ################################ # Its a test, we can delete it # ################################ - REMOVE_FILE_CMD=$(cd "${GITHUB_WORKSPACE}" || exit 1; rm -f "$FILE" 2>&1) + REMOVE_FILE_CMD=$( + cd "${GITHUB_WORKSPACE}" || exit 1 + rm -f "$FILE" 2>&1 + ) ####################### # Load the error code # @@ -96,7 +102,10 @@ CleanTestDockerFiles() { ################## # Find the files # ################## - mapfile -t FIND_CMD < <(cd "${GITHUB_WORKSPACE}" || exit 1 ; find "${GITHUB_WORKSPACE}" -type f -name "*Dockerfile" 2>&1) + mapfile -t FIND_CMD < <( + cd "${GITHUB_WORKSPACE}" || exit 1 + find "${GITHUB_WORKSPACE}" -type f -name "*Dockerfile" 2>&1 + ) ####################### # Load the error code # @@ -127,7 +136,10 @@ CleanTestDockerFiles() { ################################ # Its a test, we can delete it # ################################ - REMOVE_FILE_CMD=$(cd "${GITHUB_WORKSPACE}" || exit 1; rm -f "$FILE" 2>&1) + REMOVE_FILE_CMD=$( + cd "${GITHUB_WORKSPACE}" || exit 1 + rm -f "$FILE" 2>&1 + ) ####################### # Load the error code # @@ -153,7 +165,10 @@ CleanSHAFolder() { ################## # Find the files # ################## - REMOVE_CMD=$(cd "${GITHUB_WORKSPACE}" || exit 1; sudo rm -rf "${GITHUB_SHA}" 2>&1) + REMOVE_CMD=$( + cd "${GITHUB_WORKSPACE}" || exit 1 + sudo rm -rf "${GITHUB_SHA}" 2>&1 + ) ####################### # Load the error code # @@ -178,7 +193,10 @@ RenameTestFolder() { ##################### # Rename the folder # ##################### - RENAME_FOLDER_CMD=$(cd "${GITHUB_WORKSPACE}" || exit 1; mv "${TEST_FOLDER}" "${CLEAN_FOLDER}" 2>&1) + RENAME_FOLDER_CMD=$( + cd "${GITHUB_WORKSPACE}" || exit 1 + mv "${TEST_FOLDER}" "${CLEAN_FOLDER}" 2>&1 + ) ####################### # Load the error code # @@ -205,7 +223,10 @@ CleanPowershell() { ################## # Find the files # ################## - mapfile -t FIND_CMD < <(cd "${GITHUB_WORKSPACE}" || exit 1 ; find "${GITHUB_WORKSPACE}" -type f -name "*.psd1" 2>&1) + mapfile -t FIND_CMD < <( + cd "${GITHUB_WORKSPACE}" || exit 1 + find "${GITHUB_WORKSPACE}" -type f -name "*.psd1" 2>&1 + ) ####################### # Load the error code # @@ -236,7 +257,10 @@ CleanPowershell() { ################################ # Its a test, we can delete it # ################################ - REMOVE_FILE_CMD=$(cd "${GITHUB_WORKSPACE}" || exit 1; rm -f "$FILE" 2>&1) + REMOVE_FILE_CMD=$( + cd "${GITHUB_WORKSPACE}" || exit 1 + rm -f "$FILE" 2>&1 + ) ####################### # Load the error code # diff --git a/.automation/cleanup-docker.sh b/.automation/cleanup-docker.sh index d7c3080b..961902d7 100755 --- a/.automation/cleanup-docker.sh +++ b/.automation/cleanup-docker.sh @@ -16,13 +16,13 @@ ########### # Globals # ########### -GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace -DOCKER_USERNAME="${DOCKER_USERNAME}" # Username to login to DockerHub -DOCKER_PASSWORD="${DOCKER_PASSWORD}" # Password to login to DockerHub -IMAGE_REPO="${IMAGE_REPO}" # Image repo to upload the image -IMAGE_VERSION="${IMAGE_VERSION}" # Version to tag the image -DOCKERFILE_PATH="${DOCKERFILE_PATH}" # Path to the Dockerfile to be uploaded -(( LOG_TRACE=LOG_DEBUG=LOG_VERBOSE=LOG_NOTICE=LOG_WARN=LOG_ERROR="true" )) # Enable all loging +GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # GitHub Workspace +DOCKER_USERNAME="${DOCKER_USERNAME}" # Username to login to DockerHub +DOCKER_PASSWORD="${DOCKER_PASSWORD}" # Password to login to DockerHub +IMAGE_REPO="${IMAGE_REPO}" # Image repo to upload the image +IMAGE_VERSION="${IMAGE_VERSION}" # Version to tag the image +DOCKERFILE_PATH="${DOCKERFILE_PATH}" # Path to the Dockerfile to be uploaded +((LOG_TRACE = LOG_DEBUG = LOG_VERBOSE = LOG_NOTICE = LOG_WARN = LOG_ERROR = "true")) # Enable all loging export LOG_TRACE LOG_DEBUG LOG_VERBOSE LOG_NOTICE LOG_WARN LOG_ERROR ######################### diff --git a/.automation/test/ansible/ghe-initialize/templates/ghe-config-apply.sh b/.automation/test/ansible/ghe-initialize/templates/ghe-config-apply.sh index c7370032..39f16d0d 100644 --- a/.automation/test/ansible/ghe-initialize/templates/ghe-config-apply.sh +++ b/.automation/test/ansible/ghe-initialize/templates/ghe-config-apply.sh @@ -8,21 +8,20 @@ ########### # Globals # ########### -GHE_CONFIG_PID='/var/run/ghe-config.pid' # PID file when a config is running -GHE_APPLY_COMMAND='ghe-config-apply' # Command running when a config run -SLEEP_SECONDS=20 # Seconds to sleep before next check -PID_CHECK_LIMIT=15 # How many times to check the pid before moving on -PID_CHECK=0 # Count of times to check the pid -PROCESS_CHECK_LIMIT=15 # How many times to check the process before moving on -PROCESS_CHECK=0 # Count of times to check the process +GHE_CONFIG_PID='/var/run/ghe-config.pid' # PID file when a config is running +GHE_APPLY_COMMAND='ghe-config-apply' # Command running when a config run +SLEEP_SECONDS=20 # Seconds to sleep before next check +PID_CHECK_LIMIT=15 # How many times to check the pid before moving on +PID_CHECK=0 # Count of times to check the pid +PROCESS_CHECK_LIMIT=15 # How many times to check the process before moving on +PROCESS_CHECK=0 # Count of times to check the process ################################################################################ ########################### SUB ROUTINES BELOW ################################# ################################################################################ ################################################################################ #### Function CheckGHEPid ###################################################### -CheckGHEPid() -{ +CheckGHEPid() { ################################## # Check to prevent infinite loop # ################################## @@ -75,8 +74,7 @@ CheckGHEPid() } ################################################################################ #### Function CheckGHEProcess ################################################## -CheckGHEProcess() -{ +CheckGHEProcess() { ################################## # Check to prevent infinite loop # ################################## @@ -139,8 +137,7 @@ CheckGHEProcess() } ################################################################################ #### Function RunConfigApply ################################################### -RunConfigApply() -{ +RunConfigApply() { ########## # Header # ########## diff --git a/.automation/test/ansible/ghe-initialize/templates/ldap-settings.json.j2 b/.automation/test/ansible/ghe-initialize/templates/ldap-settings.json.j2 index 4b692f95..2391ad23 100644 --- a/.automation/test/ansible/ghe-initialize/templates/ldap-settings.json.j2 +++ b/.automation/test/ansible/ghe-initialize/templates/ldap-settings.json.j2 @@ -4,7 +4,7 @@ "host": "{{ ldap_host }}", "port": {{ ldap_port }}, "base": [ - "{{ ldap_base_dn }}" + "{{ ldap_base_dn }}" ], "uid": null, "bind_dn": "{{ ldap_bind_dn }}", diff --git a/.automation/test/ansible/ghe-initialize/templates/splunk-settings.json.j2 b/.automation/test/ansible/ghe-initialize/templates/splunk-settings.json.j2 index 5c716889..30f63e26 100644 --- a/.automation/test/ansible/ghe-initialize/templates/splunk-settings.json.j2 +++ b/.automation/test/ansible/ghe-initialize/templates/splunk-settings.json.j2 @@ -1,9 +1,9 @@ { "syslog": { - "enabled": true, - "server": "{{ splunk_host }}:{{ splunk_port }}", - "protocol_name": "udp", - "tls_enabled": false, - "cert": null + "enabled": true, + "server": "{{ splunk_host }}:{{ splunk_port }}", + "protocol_name": "udp", + "tls_enabled": false, + "cert": null } } diff --git a/.automation/test/arm/arm_good_1.json b/.automation/test/arm/arm_good_1.json index df09afb7..635144fa 100644 --- a/.automation/test/arm/arm_good_1.json +++ b/.automation/test/arm/arm_good_1.json @@ -50,4 +50,4 @@ "value": "[reference(resourceId('Microsoft.Network/virtualNetworks',variables('Network.Name')), '2019-12-01', 'Full')]" } } -} \ No newline at end of file +} diff --git a/.automation/test/clojure/clojure_good_1.clj b/.automation/test/clojure/clojure_good_1.clj index 391f4688..f10b9497 100644 --- a/.automation/test/clojure/clojure_good_1.clj +++ b/.automation/test/clojure/clojure_good_1.clj @@ -1,6 +1,6 @@ (ns foo (:require - [clojure.string :as str])) + [clojure.string :as str])) (butlast [1 2 3]) @@ -11,8 +11,8 @@ (y))) (letfn - [(f [g] (h g)) - (h [i] (f i))]) + [(f [g] (h g)) + (h [i] (f i))]) (defn foo [] 1) (inc (foo)) @@ -31,4 +31,4 @@ (ns bar-test (:require [clojure.test :as t])) (t/deftest my-tests - (t/is (odd? (inc 1)))) \ No newline at end of file + (t/is (odd? (inc 1)))) diff --git a/.automation/test/cloudformation/cloudformation_good_1.json b/.automation/test/cloudformation/cloudformation_good_1.json index dc944bca..d3ff11e2 100644 --- a/.automation/test/cloudformation/cloudformation_good_1.json +++ b/.automation/test/cloudformation/cloudformation_good_1.json @@ -1,35 +1,35 @@ { - "AWSTemplateFormatVersion": "2010-09-09", - "Description": "A sample template", - "Resources": { - "DNS": { - "Type": "AWS::Route53::HostedZone", - "Properties": { - "HostedZoneConfig": { - "Comment": "Myhostedzoneforexample.com" - }, - "Name": "example.com", - "VPCs": [ - { - "VPCId": "vpc-abcd1234", - "VPCRegion": "ap-northeast-1" - }, - { - "VPCId": "vpc-efgh5678", - "VPCRegion": "us-west-2" - } - ], - "HostedZoneTags": [ - { - "Key": "SampleKey1", - "Value": "SampleValue1" - }, - { - "Key": "SampleKey2", - "Value": "SampleValue2" - } - ] - } - } - } + "AWSTemplateFormatVersion": "2010-09-09", + "Description": "A sample template", + "Resources": { + "DNS": { + "Type": "AWS::Route53::HostedZone", + "Properties": { + "HostedZoneConfig": { + "Comment": "Myhostedzoneforexample.com" + }, + "Name": "example.com", + "VPCs": [ + { + "VPCId": "vpc-abcd1234", + "VPCRegion": "ap-northeast-1" + }, + { + "VPCId": "vpc-efgh5678", + "VPCRegion": "us-west-2" + } + ], + "HostedZoneTags": [ + { + "Key": "SampleKey1", + "Value": "SampleValue1" + }, + { + "Key": "SampleKey2", + "Value": "SampleValue2" + } + ] + } + } + } } diff --git a/.automation/test/cloudformation/cloudformation_good_3.json b/.automation/test/cloudformation/cloudformation_good_3.json index f8602d7a..e38194ce 100644 --- a/.automation/test/cloudformation/cloudformation_good_3.json +++ b/.automation/test/cloudformation/cloudformation_good_3.json @@ -1,16 +1,16 @@ { - "Resources" : { - "myDNSRecord" : { - "Type" : "AWS::Route53::RecordSet", - "Properties" : { - "HostedZoneId" : "Z8VLZEXAMPLE", - "Name" : "test.example.com", - "ResourceRecords" : [ - "192.0.2.99" - ], - "TTL" : 300, - "Type" : "A" - } - } - } + "Resources": { + "myDNSRecord": { + "Type": "AWS::Route53::RecordSet", + "Properties": { + "HostedZoneId": "Z8VLZEXAMPLE", + "Name": "test.example.com", + "ResourceRecords": [ + "192.0.2.99" + ], + "TTL": 300, + "Type": "A" + } + } + } } diff --git a/.automation/test/coffeescript/coffeescript_good_1.coffee b/.automation/test/coffeescript/coffeescript_good_1.coffee index 064f850e..388f28d7 100644 --- a/.automation/test/coffeescript/coffeescript_good_1.coffee +++ b/.automation/test/coffeescript/coffeescript_good_1.coffee @@ -62,8 +62,8 @@ module.exports = (robot) -> # Drop the hammer # ################### robot.respond /drop the hammer/i, (msg) -> - msg.send "Commencing the hammer dropping..." - msg.send msg.random dropHammer + msg.send "Commencing the hammer dropping..." + msg.send msg.random dropHammer ############### # Vape Nation # diff --git a/.automation/test/csharp/csharp_good_01.cs b/.automation/test/csharp/csharp_good_01.cs index a68542dc..b17954e5 100644 --- a/.automation/test/csharp/csharp_good_01.cs +++ b/.automation/test/csharp/csharp_good_01.cs @@ -2,11 +2,11 @@ using System; namespace HelloWorld { - class Program + class Program + { + static void Main(string[] args) { - static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - } + Console.WriteLine("Hello World!"); } + } } diff --git a/.automation/test/editorconfig-checker/.editorconfig b/.automation/test/editorconfig/.editorconfig similarity index 100% rename from .automation/test/editorconfig-checker/.editorconfig rename to .automation/test/editorconfig/.editorconfig diff --git a/.automation/test/editorconfig-checker/README.md b/.automation/test/editorconfig/README.md similarity index 82% rename from .automation/test/editorconfig-checker/README.md rename to .automation/test/editorconfig/README.md index d091c16e..8016cf91 100644 --- a/.automation/test/editorconfig-checker/README.md +++ b/.automation/test/editorconfig/README.md @@ -1,6 +1,6 @@ -# EDITORCONFIG_CHECKER Test Cases +# EDITORCONFIG Test Cases -This folder holds the test cases for **EDITORCONFIG_CHECKER**. +This folder holds the test cases for **EDITORCONFIG**. ## Additional Docs diff --git a/.automation/test/editorconfig-checker/editorconfig-checker_bad_1.ext b/.automation/test/editorconfig/editorconfig-checker_bad_1.ext similarity index 100% rename from .automation/test/editorconfig-checker/editorconfig-checker_bad_1.ext rename to .automation/test/editorconfig/editorconfig-checker_bad_1.ext diff --git a/.automation/test/editorconfig-checker/editorconfig-checker_good_1.ext b/.automation/test/editorconfig/editorconfig-checker_good_1.ext similarity index 100% rename from .automation/test/editorconfig-checker/editorconfig-checker_good_1.ext rename to .automation/test/editorconfig/editorconfig-checker_good_1.ext diff --git a/.automation/test/groovy/README.md b/.automation/test/groovy/README.md index b08a3b4f..8dc5badf 100644 --- a/.automation/test/groovy/README.md +++ b/.automation/test/groovy/README.md @@ -1,5 +1,5 @@ # Groovy Test Cases -This folder holds the test cases for **Groovy**. +This folder holds the test cases for **Groovy**. ## Additional Docs No Additional information is needed for this test case. diff --git a/.automation/test/groovy/groovy_good_01.groovy b/.automation/test/groovy/groovy_good_01.groovy index d0375dab..90941461 100644 --- a/.automation/test/groovy/groovy_good_01.groovy +++ b/.automation/test/groovy/groovy_good_01.groovy @@ -1,6 +1,6 @@ class Example { - static void main(String[] args) { - File file = new File("E:/Example.txt") - println "The file ${file.absolutePath} has ${file.length()} bytes" - } + static void main(String[] args) { + File file = new File("E:/Example.txt") + println "The file ${file.absolutePath} has ${file.length()} bytes" + } } diff --git a/.automation/test/html/html_good_01.html b/.automation/test/html/html_good_01.html index 1b10ca4e..d3a039bf 100644 --- a/.automation/test/html/html_good_01.html +++ b/.automation/test/html/html_good_01.html @@ -1,10 +1,13 @@ -
- -