Skip to content

Commit

Permalink
Adding support for Go language. (#19941)
Browse files Browse the repository at this point in the history
* Adding support for Go language.

* extra commit

* Adding support for go language.

* Adding support for go language.

* Adding support of GO language.

* Adding support for Go language
  • Loading branch information
t-shreysingh authored Jun 3, 2024
1 parent 78b51e7 commit 65a6aa1
Show file tree
Hide file tree
Showing 16 changed files with 103 additions and 34 deletions.
15 changes: 15 additions & 0 deletions Tasks/AzureTestPlanV0/Invokers/goinvoker.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import tl = require('azure-pipelines-task-lib/task');
import utils = require('../utils');
import constants = require('../constants');

export async function executeGoTests(testsToBeExecuted: string[]): Promise<number> {

//Go execution will be added
/*executable = go;
args = test, ./...
spawn*/

console.log("Go changes1");
return 1;
}

8 changes: 7 additions & 1 deletion Tasks/AzureTestPlanV0/automatedTestInvoker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { executePythonTests } from './Invokers/pythoninvoker'
import { executeMavenTests } from './Invokers/maveninvoker'
import { executeGradleTests } from './Invokers/gradleinvoker'
import { ciDictionary } from './ciEventLogger';

import { executeGoTests } from './Invokers/goinvoker';
export async function testInvoker(testsToBeExecuted: string[], ciData: ciDictionary): Promise<number> {

const testLanguageStrings = tl.getDelimitedInput('testLanguageInput', ',', true);
Expand Down Expand Up @@ -37,6 +37,12 @@ export async function testInvoker(testsToBeExecuted: string[], ciData: ciDiction
ciData["isPythonExecution"] = true;
break;

case 'Go':
exitCode = await executeGoTests(testsToBeExecuted);
tl.debug(`Execution Status Code for Go: ${exitCode}`);
ciData["isGoExecution"] = true;
break;

default:
console.log('Invalid test Language Input selected.');
ciData["NoLanguageInput"] = true;
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureTestPlanV0/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ export const NOT_AUTOMATED = 'Not Automated'
export const MERGE_THRESHOLD = 100;
export const AUTOMATED_EXECUTION = "AutomatedExecutionPhase";
export const AUTOMATED_PUBLISHING = "PublishingAutomatedResultsPhase";
export const MANUALTESTS_PUBLISHING = "ManualTestResultsPublishingPhase";
export const MANUALTESTS_PUBLISHING = "ManualTestResultsPublishingPhase";
7 changes: 4 additions & 3 deletions Tasks/AzureTestPlanV0/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 0,
"Minor": 238,
"Patch": 12
"Minor": 241,
"Patch": 0
},
"preview": true,
"demands": [],
Expand Down Expand Up @@ -79,7 +79,8 @@
"options": {
"Java-Maven": "Java-Maven",
"Java-Gradle": "Java-Gradle",
"Python": "Python"
"Python": "Python",
"Go": "Go"
},
"properties": {
"MultiSelectFlatList": "True"
Expand Down
7 changes: 4 additions & 3 deletions Tasks/AzureTestPlanV0/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 0,
"Minor": 238,
"Patch": 12
"Minor": 241,
"Patch": 0
},
"preview": true,
"demands": [],
Expand Down Expand Up @@ -79,7 +79,8 @@
"options": {
"Java-Maven": "Java-Maven",
"Java-Gradle": "Java-Gradle",
"Python": "Python"
"Python": "Python",
"Go": "Go"
},
"properties": {
"MultiSelectFlatList": "True"
Expand Down
4 changes: 2 additions & 2 deletions _generated/AzureTestPlanV0.versionmap.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Default|0.238.12
Node20-225|0.238.13
Default|0.241.0
Node20-225|0.241.1
15 changes: 15 additions & 0 deletions _generated/AzureTestPlanV0/Invokers/goinvoker.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import tl = require('azure-pipelines-task-lib/task');
import utils = require('../utils');
import constants = require('../constants');

export async function executeGoTests(testsToBeExecuted: string[]): Promise<number> {

//Go execution will be added
/*executable = go;
args = test, ./...
spawn*/

console.log("Go changes1");
return 1;
}

8 changes: 7 additions & 1 deletion _generated/AzureTestPlanV0/automatedTestInvoker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { executePythonTests } from './Invokers/pythoninvoker'
import { executeMavenTests } from './Invokers/maveninvoker'
import { executeGradleTests } from './Invokers/gradleinvoker'
import { ciDictionary } from './ciEventLogger';

import { executeGoTests } from './Invokers/goinvoker';
export async function testInvoker(testsToBeExecuted: string[], ciData: ciDictionary): Promise<number> {

const testLanguageStrings = tl.getDelimitedInput('testLanguageInput', ',', true);
Expand Down Expand Up @@ -37,6 +37,12 @@ export async function testInvoker(testsToBeExecuted: string[], ciData: ciDiction
ciData["isPythonExecution"] = true;
break;

case 'Go':
exitCode = await executeGoTests(testsToBeExecuted);
tl.debug(`Execution Status Code for Go: ${exitCode}`);
ciData["isGoExecution"] = true;
break;

default:
console.log('Invalid test Language Input selected.');
ciData["NoLanguageInput"] = true;
Expand Down
2 changes: 1 addition & 1 deletion _generated/AzureTestPlanV0/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ export const NOT_AUTOMATED = 'Not Automated'
export const MERGE_THRESHOLD = 100;
export const AUTOMATED_EXECUTION = "AutomatedExecutionPhase";
export const AUTOMATED_PUBLISHING = "PublishingAutomatedResultsPhase";
export const MANUALTESTS_PUBLISHING = "ManualTestResultsPublishingPhase";
export const MANUALTESTS_PUBLISHING = "ManualTestResultsPublishingPhase";
11 changes: 6 additions & 5 deletions _generated/AzureTestPlanV0/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 0,
"Minor": 238,
"Patch": 12
"Minor": 241,
"Patch": 0
},
"preview": true,
"demands": [],
Expand Down Expand Up @@ -79,7 +79,8 @@
"options": {
"Java-Maven": "Java-Maven",
"Java-Gradle": "Java-Gradle",
"Python": "Python"
"Python": "Python",
"Go": "Go"
},
"properties": {
"MultiSelectFlatList": "True"
Expand Down Expand Up @@ -179,7 +180,7 @@
"MultipleMatchingGradlewFound": "Multiple gradlew files found. Selecting the first matched instance"
},
"_buildConfigMapping": {
"Default": "0.238.12",
"Node20-225": "0.238.13"
"Default": "0.241.0",
"Node20-225": "0.241.1"
}
}
11 changes: 6 additions & 5 deletions _generated/AzureTestPlanV0/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 0,
"Minor": 238,
"Patch": 12
"Minor": 241,
"Patch": 0
},
"preview": true,
"demands": [],
Expand Down Expand Up @@ -79,7 +79,8 @@
"options": {
"Java-Maven": "Java-Maven",
"Java-Gradle": "Java-Gradle",
"Python": "Python"
"Python": "Python",
"Go": "Go"
},
"properties": {
"MultiSelectFlatList": "True"
Expand Down Expand Up @@ -179,7 +180,7 @@
"MultipleMatchingGradlewFound": "ms-resource:loc.messages.MultipleMatchingGradlewFound"
},
"_buildConfigMapping": {
"Default": "0.238.12",
"Node20-225": "0.238.13"
"Default": "0.241.0",
"Node20-225": "0.241.1"
}
}
15 changes: 15 additions & 0 deletions _generated/AzureTestPlanV0_Node20/Invokers/goinvoker.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import tl = require('azure-pipelines-task-lib/task');
import utils = require('../utils');
import constants = require('../constants');

export async function executeGoTests(testsToBeExecuted: string[]): Promise<number> {

//Go execution will be added
/*executable = go;
args = test, ./...
spawn*/

console.log("Go changes1");
return 1;
}

8 changes: 7 additions & 1 deletion _generated/AzureTestPlanV0_Node20/automatedTestInvoker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { executePythonTests } from './Invokers/pythoninvoker'
import { executeMavenTests } from './Invokers/maveninvoker'
import { executeGradleTests } from './Invokers/gradleinvoker'
import { ciDictionary } from './ciEventLogger';

import { executeGoTests } from './Invokers/goinvoker';
export async function testInvoker(testsToBeExecuted: string[], ciData: ciDictionary): Promise<number> {

const testLanguageStrings = tl.getDelimitedInput('testLanguageInput', ',', true);
Expand Down Expand Up @@ -37,6 +37,12 @@ export async function testInvoker(testsToBeExecuted: string[], ciData: ciDiction
ciData["isPythonExecution"] = true;
break;

case 'Go':
exitCode = await executeGoTests(testsToBeExecuted);
tl.debug(`Execution Status Code for Go: ${exitCode}`);
ciData["isGoExecution"] = true;
break;

default:
console.log('Invalid test Language Input selected.');
ciData["NoLanguageInput"] = true;
Expand Down
2 changes: 1 addition & 1 deletion _generated/AzureTestPlanV0_Node20/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ export const NOT_AUTOMATED = 'Not Automated'
export const MERGE_THRESHOLD = 100;
export const AUTOMATED_EXECUTION = "AutomatedExecutionPhase";
export const AUTOMATED_PUBLISHING = "PublishingAutomatedResultsPhase";
export const MANUALTESTS_PUBLISHING = "ManualTestResultsPublishingPhase";
export const MANUALTESTS_PUBLISHING = "ManualTestResultsPublishingPhase";
11 changes: 6 additions & 5 deletions _generated/AzureTestPlanV0_Node20/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 0,
"Minor": 238,
"Patch": 13
"Minor": 241,
"Patch": 1
},
"preview": true,
"demands": [],
Expand Down Expand Up @@ -79,7 +79,8 @@
"options": {
"Java-Maven": "Java-Maven",
"Java-Gradle": "Java-Gradle",
"Python": "Python"
"Python": "Python",
"Go": "Go"
},
"properties": {
"MultiSelectFlatList": "True"
Expand Down Expand Up @@ -183,7 +184,7 @@
"MultipleMatchingGradlewFound": "Multiple gradlew files found. Selecting the first matched instance"
},
"_buildConfigMapping": {
"Default": "0.238.12",
"Node20-225": "0.238.13"
"Default": "0.241.0",
"Node20-225": "0.241.1"
}
}
11 changes: 6 additions & 5 deletions _generated/AzureTestPlanV0_Node20/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 0,
"Minor": 238,
"Patch": 13
"Minor": 241,
"Patch": 1
},
"preview": true,
"demands": [],
Expand Down Expand Up @@ -79,7 +79,8 @@
"options": {
"Java-Maven": "Java-Maven",
"Java-Gradle": "Java-Gradle",
"Python": "Python"
"Python": "Python",
"Go": "Go"
},
"properties": {
"MultiSelectFlatList": "True"
Expand Down Expand Up @@ -183,7 +184,7 @@
"MultipleMatchingGradlewFound": "ms-resource:loc.messages.MultipleMatchingGradlewFound"
},
"_buildConfigMapping": {
"Default": "0.238.12",
"Node20-225": "0.238.13"
"Default": "0.241.0",
"Node20-225": "0.241.1"
}
}

0 comments on commit 65a6aa1

Please sign in to comment.