From c13ffc74fa143a8b6b9127898de4963ca015d974 Mon Sep 17 00:00:00 2001 From: jeffrapid <91499603+jeffrapid@users.noreply.github.com> Date: Wed, 4 May 2022 13:00:40 -0400 Subject: [PATCH 1/6] console log check --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index 6b0056a..e16cd1e 100644 --- a/index.js +++ b/index.js @@ -31,6 +31,7 @@ core.group('Execute Test', async () => { // 1. Trigger Test const envString = ENVIRONMENT ? `&enviroment=${ENVIRONMENT}` : ''; const testTrigger = (await axios.get(`${API_URL}/test/${TEST_ID}/execute?source=gh_action&location=${LOCATION}${envString}`)).data; + console.log(testTrigger) const reportUrl = testTrigger.reportUrl; console.log(testTrigger.message); core.setOutput("reportUrl", reportUrl); From 40f8482b795f25c712946f617492b854becae9d3 Mon Sep 17 00:00:00 2001 From: jeffrapid <91499603+jeffrapid@users.noreply.github.com> Date: Wed, 4 May 2022 13:15:38 -0400 Subject: [PATCH 2/6] add instance input --- index.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index e16cd1e..e9f91ed 100644 --- a/index.js +++ b/index.js @@ -6,7 +6,10 @@ const axios = require('axios'); const WAIT_TIME = 1000; const MAX_TRIES = 300; const FIRST_WAIT = 2000; -const API_URL = "https://rapidapi.com/testing/api/trigger"; +//jeff.hub.rapidapi +//rapidapi +=`https://{$instance}/testing/api/trigger` +const API_URL = ""; // INPUTS const TEST_ID = core.getInput('test'); @@ -15,6 +18,9 @@ console.log(`Executing Test ID: ${TEST_ID}`); const LOCATION = core.getInput('location'); console.log(`Executing In Location: ${LOCATION}`); +const INSTANCE = core.getInput('instance'); +console.log(`Executing In Instance: ${INSTANCE}`); + const ENVIRONMENT = core.getInput('environment') || null; console.log(`Executing In Env: ${ENVIRONMENT}`); @@ -30,6 +36,8 @@ function sleep(time) { core.group('Execute Test', async () => { // 1. Trigger Test const envString = ENVIRONMENT ? `&enviroment=${ENVIRONMENT}` : ''; + const instance = INSTANCE; + const API_URL = =`https://${INSTANCE}/testing/api/trigger` const testTrigger = (await axios.get(`${API_URL}/test/${TEST_ID}/execute?source=gh_action&location=${LOCATION}${envString}`)).data; console.log(testTrigger) const reportUrl = testTrigger.reportUrl; From d94400c4be5ed2df2a3d0a9b9dabc10d98d833a5 Mon Sep 17 00:00:00 2001 From: jeffrapid <91499603+jeffrapid@users.noreply.github.com> Date: Wed, 4 May 2022 13:19:34 -0400 Subject: [PATCH 3/6] fix --- index.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/index.js b/index.js index e9f91ed..2a08a1e 100644 --- a/index.js +++ b/index.js @@ -6,9 +6,6 @@ const axios = require('axios'); const WAIT_TIME = 1000; const MAX_TRIES = 300; const FIRST_WAIT = 2000; -//jeff.hub.rapidapi -//rapidapi -=`https://{$instance}/testing/api/trigger` const API_URL = ""; // INPUTS From af585617cf47807f1dc515fd376665c8a4e5ea0c Mon Sep 17 00:00:00 2001 From: jeffrapid <91499603+jeffrapid@users.noreply.github.com> Date: Wed, 4 May 2022 13:20:32 -0400 Subject: [PATCH 4/6] fix --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 2a08a1e..bc69498 100644 --- a/index.js +++ b/index.js @@ -34,7 +34,7 @@ core.group('Execute Test', async () => { // 1. Trigger Test const envString = ENVIRONMENT ? `&enviroment=${ENVIRONMENT}` : ''; const instance = INSTANCE; - const API_URL = =`https://${INSTANCE}/testing/api/trigger` + const API_URL = `https://${INSTANCE}/testing/api/trigger` const testTrigger = (await axios.get(`${API_URL}/test/${TEST_ID}/execute?source=gh_action&location=${LOCATION}${envString}`)).data; console.log(testTrigger) const reportUrl = testTrigger.reportUrl; From b3761df644729d25ac5503b0e51da46a60efa7e1 Mon Sep 17 00:00:00 2001 From: jeffrapid <91499603+jeffrapid@users.noreply.github.com> Date: Wed, 4 May 2022 13:25:09 -0400 Subject: [PATCH 5/6] fix the instance --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index bc69498..f19603b 100644 --- a/index.js +++ b/index.js @@ -6,7 +6,7 @@ const axios = require('axios'); const WAIT_TIME = 1000; const MAX_TRIES = 300; const FIRST_WAIT = 2000; -const API_URL = ""; + // INPUTS const TEST_ID = core.getInput('test'); @@ -34,7 +34,7 @@ core.group('Execute Test', async () => { // 1. Trigger Test const envString = ENVIRONMENT ? `&enviroment=${ENVIRONMENT}` : ''; const instance = INSTANCE; - const API_URL = `https://${INSTANCE}/testing/api/trigger` + const API_URL = `https://${INSTANCE}.com/testing/api/trigger` const testTrigger = (await axios.get(`${API_URL}/test/${TEST_ID}/execute?source=gh_action&location=${LOCATION}${envString}`)).data; console.log(testTrigger) const reportUrl = testTrigger.reportUrl; From 70b0a296d1c7c788424baf9ad8dc05b13e823d3e Mon Sep 17 00:00:00 2001 From: Alex Walling Date: Wed, 4 May 2022 15:48:41 -0700 Subject: [PATCH 6/6] Update index.js Add default as rapidapi if the parameter is not provided --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index f19603b..ddc7f1b 100644 --- a/index.js +++ b/index.js @@ -15,7 +15,7 @@ console.log(`Executing Test ID: ${TEST_ID}`); const LOCATION = core.getInput('location'); console.log(`Executing In Location: ${LOCATION}`); -const INSTANCE = core.getInput('instance'); +const INSTANCE = core.getInput('instance') || "rapidapi"; console.log(`Executing In Instance: ${INSTANCE}`); const ENVIRONMENT = core.getInput('environment') || null;