Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Users/shreyas r msft/input parser migration #7021

Merged
merged 12 commits into from
May 10, 2018
Original file line number Diff line number Diff line change
Expand Up @@ -168,5 +168,6 @@
"loc.messages.OnlyWindowsOsSupported": "This task is supported only on Windows agents and cannot be used on other platforms.",
"loc.messages.MultiConfigNotSupportedWithOnDemand": "On demand runs are not supported with Multi-Configuration option. Please use 'None' or 'Multi-agent' parallelism option.",
"loc.messages.disabledRerun": "Disabling the rerun of failed tests as the rerun threshold provided is %s",
"loc.messages.UpgradeAgentMessage": "Please upgrade your vsts-agent version. https://github.com/Microsoft/vsts-agent/releases"
"loc.messages.UpgradeAgentMessage": "Please upgrade your vsts-agent version. https://github.com/Microsoft/vsts-agent/releases",
"loc.messages.VsTestVersionEmpty": "VsTestVersion is null or empty"
}
2 changes: 1 addition & 1 deletion Tasks/VsTest/Tests/L0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('VsTest Suite', function() {
interfacesDictionary[interfaceName] = interfacePropertiesDictionary;
});

checkParity(inputDataContractParityToolOutput, interfacesDictionary, interfacesDictionary['InputDataContract']);
checkParity(inputDataContractParityToolOutput, interfacesDictionary, interfacesDictionary.InputDataContract);

function checkParity(dataContractObject: any, interfacesDictionary: any, subInterface: any) {

Expand Down
6 changes: 6 additions & 0 deletions Tasks/VsTest/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,10 @@ export module ResultMessages {

export module VsTestToolsInstaller {
export const PathToVsTestToolVariable = 'VsTestToolsInstallerInstalledToolLocation';
}

export module DistributionTypes {
export const EXECUTIONTIMEBASED = 'TestExecutionTimes';
export const ASSEMBLYBASED = 'TestAssemblies';
export const NUMBEROFTESTMETHODSBASED = 'numberoftestmethods';
}
285 changes: 75 additions & 210 deletions Tasks/VsTest/distributedtest.ts

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions Tasks/VsTest/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,4 +215,16 @@ export class Helper {
public static stringToBool(inputString : string) : boolean {
return !this.isNullEmptyOrUndefined(inputString) && inputString.toLowerCase() === 'true';
}

public static uploadFile(file: string): void {
try {
if (Helper.pathExistsAsFile(file)) {
const stats = fs.statSync(file);
tl.debug('File exists. Size: ' + stats.size + ' Bytes');
console.log('##vso[task.uploadfile]' + file);
}
} catch (err) {
tl.debug(`Failed to upload file ${file} with error ${err}`);
}
}
}
35 changes: 7 additions & 28 deletions Tasks/VsTest/inputdatacontract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ export interface InputDataContract {
AgentName : string;
AccessToken : string;
CollectionUri : string;
EnvironmentUri : string;
RunIdentifier : string;
TeamProject : string;
TestSelectionSettings : TestSelectionSettings;
VsTestConsolePath : string;
UsingXCopyTestPlatformPackage : boolean;
TestReportingSettings : TestReportingSettings;
TfsSpecificSettings : TfsSpecificSettings;
TargetBinariesSettings : TargetBinariesSettings;
Expand All @@ -13,27 +15,9 @@ export interface InputDataContract {
DistributionSettings : DistributionSettings;
ExecutionSettings : ExecutionSettings;
Logging : Logging;
UseVsTestConsole : boolean;
TestPlatformVersion : string;
COR_PROFILER_PATH_32 : string;
COR_PROFILER_PATH_64 : string;
ForcePlatformV2 : boolean;
VisualStudioPath : string;
TestWindowPath : string;
TiaRunIdFile : string;
ResponseFile : string;
ResponseSupplementryFilePath : string;
TiaBaseLineBuildIdFile : string;
VsVersion : string;
VsVersionIsTestSettingsPropertiesSupported : boolean;
RerunIterationCount : number;
AgentVersion : string;
VstestTaskInstanceIdentifier : string;
MiniMatchTestSourcesFile : string;
UseNewCollector : boolean;
IsPrFlow : boolean;
UseTestCaseFilterInResponseFile : boolean;
DisableEnablingDataCollector : boolean;
}

export interface TestReportingSettings {
Expand All @@ -43,14 +27,10 @@ export interface TestReportingSettings {

export interface TestSelectionSettings {
TestSelectionType : string;
AssemblyBasedTestSelection : AssemblyBasedTestSelection;
TestPlanTestSuiteSettings : TestPlanTestSuiteSettings;
SearchFolder : string;
TestCaseFilter : string;
}

export interface AssemblyBasedTestSelection {
SourceFilter : string;
TestSourcesFile : string;
}

export interface TestPlanTestSuiteSettings {
Expand Down Expand Up @@ -86,15 +66,15 @@ export interface ProxySettings {

export interface RerunSettings {
RerunFailedTests : boolean;
RerunType : string;
RerunFailedTestCasesMaxLimit : number;
RerunFailedThreshold : number;
RerunMaxAttempts : number;
}

export interface DistributionSettings {
TestCaseLevelSlicingEnabled : boolean;
DistributeTestsBasedOn : string;
NumberOfTestAgents : number;
IsTimeBasedSlicing : boolean;
RunTimePerSlice : number;
NumberOfTestCasesPerSlice : number;
}
Expand All @@ -109,14 +89,13 @@ export interface ExecutionSettings {
SettingsFile : string;
OverridenParameters : string;
RerunSettings : RerunSettings;
IsToolsInstallerFlow : boolean;
VstestConsolePath : string;
TiaSettings : TiaSettings;
VideoDataCollectorEnabled : boolean;
}

export interface TiaSettings {
Enabled : boolean;
DisableDataCollection : boolean;
RebaseLimit : number;
SourcesDirectory : string;
FileLevel : boolean;
Expand Down
Loading