Skip to content

Commit 7f73b3c

Browse files
authored
Merge pull request #4204 from Microsoft/users/jikuma/KubernetesM116
Users/jikuma/kubernetes m116
2 parents 9626058 + fc1c610 commit 7f73b3c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+9441
-6
lines changed

Tasks/Common/docker-common/registryauthenticationprovider/acrauthenticationtokenprovider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default class ACRAuthenticationTokenProvider extends AuthenticationTokenP
2929
public getAuthenticationToken(): RegistryAuthenticationToken
3030
{
3131
if(this.registryURL && this.endpointName) {
32-
return new RegistryAuthenticationToken(tl.getEndpointAuthorizationParameter(this.endpointName, 'serviceprincipalid', true), tl.getEndpointAuthorizationParameter(this.endpointName, 'serviceprincipalkey', true), this.registryURL);
32+
return new RegistryAuthenticationToken(tl.getEndpointAuthorizationParameter(this.endpointName, 'serviceprincipalid', true), tl.getEndpointAuthorizationParameter(this.endpointName, 'serviceprincipalkey', true), this.registryURL, "ServicePrincipal@AzureRM");
3333
}
3434

3535
return null;

Tasks/Common/docker-common/registryauthenticationprovider/genericauthenticationtokenprovider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default class GenericAuthenticationTokenProvider extends AuthenticationTo
1919
public getAuthenticationToken(): RegistryAuthenticationToken {
2020

2121
if(this.registryAuth) {
22-
return new RegistryAuthenticationToken(this.registryAuth["username"], this.registryAuth["password"], this.registryAuth["registry"]);
22+
return new RegistryAuthenticationToken(this.registryAuth["username"], this.registryAuth["password"], this.registryAuth["registry"], this.registryAuth["email"]);
2323
}
2424

2525
return null;

Tasks/Common/docker-common/registryauthenticationprovider/registryauthenticationtoken.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ export default class RegistryServerAuthenticationToken {
1010
// registry login server creds
1111
private username: string;
1212
private password: string;
13+
private email: string;
1314

14-
constructor(username: string, authenticationPassword: string, registry: string) {
15+
constructor(username: string, authenticationPassword: string, registry: string, email: string) {
1516

1617
// Replace it with setvariable once vsts-task-lib is updated
1718
console.log("##vso[task.setvariable variable=CONTAINER_USERNAME;issecret=true;]" + username);
@@ -20,8 +21,9 @@ export default class RegistryServerAuthenticationToken {
2021
this.registry = registry;
2122
this.password = authenticationPassword;
2223
this.username = username;
24+
this.email = email;
2325
}
24-
26+
2527
public getUsername(): string {
2628
return this.username;
2729
}
@@ -34,4 +36,8 @@ export default class RegistryServerAuthenticationToken {
3436
return this.registry;
3537
}
3638

39+
public getEmail(): string {
40+
return this.email;
41+
}
42+
3743
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
"use strict";
2+
3+
var https = require('https');
4+
var fs = require('fs');
5+
import * as tl from "vsts-task-lib/task";
6+
7+
export async function download(url: string, downloadPath: string): Promise<void> {
8+
var file = fs.createWriteStream(downloadPath);
9+
await new Promise((resolve, reject) => {
10+
var req = https.request(url, res => {
11+
tl.debug("statusCode: " + res.statusCode);
12+
res.pipe(file);
13+
res.on("error", err => reject(err));
14+
res.on("end", () => {
15+
tl.debug("File download completed");
16+
resolve();
17+
});
18+
});
19+
20+
req.on("error", err => {
21+
tl.debug(err);
22+
reject(err);
23+
});
24+
25+
req.end();
26+
});
27+
28+
file.end(null, null, file.close);
29+
}
Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
// Generated by typings
2+
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/a361a8ab3c327f208d3f82ad206971d4a63d8c25/mocha/mocha.d.ts
3+
interface MochaSetupOptions {
4+
//milliseconds to wait before considering a test slow
5+
slow?: number;
6+
7+
// timeout in milliseconds
8+
timeout?: number;
9+
10+
// ui name "bdd", "tdd", "exports" etc
11+
ui?: string;
12+
13+
//array of accepted globals
14+
globals?: any[];
15+
16+
// reporter instance (function or string), defaults to `mocha.reporters.Spec`
17+
reporter?: any;
18+
19+
// bail on the first test failure
20+
bail?: boolean;
21+
22+
// ignore global leaks
23+
ignoreLeaks?: boolean;
24+
25+
// grep string or regexp to filter tests with
26+
grep?: any;
27+
}
28+
29+
declare var mocha: Mocha;
30+
declare var describe: Mocha.IContextDefinition;
31+
declare var xdescribe: Mocha.IContextDefinition;
32+
// alias for `describe`
33+
declare var context: Mocha.IContextDefinition;
34+
// alias for `describe`
35+
declare var suite: Mocha.IContextDefinition;
36+
declare var it: Mocha.ITestDefinition;
37+
declare var xit: Mocha.ITestDefinition;
38+
// alias for `it`
39+
declare var test: Mocha.ITestDefinition;
40+
declare var specify: Mocha.ITestDefinition;
41+
42+
interface MochaDone {
43+
(error?: any): any;
44+
}
45+
46+
interface ActionFunction {
47+
(done: MochaDone): any | PromiseLike<any>
48+
}
49+
50+
declare function setup(action: ActionFunction): void;
51+
declare function teardown(action: ActionFunction): void;
52+
declare function suiteSetup(action: ActionFunction): void;
53+
declare function suiteTeardown(action: ActionFunction): void;
54+
declare function before(action: ActionFunction): void;
55+
declare function before(description: string, action: ActionFunction): void;
56+
declare function after(action: ActionFunction): void;
57+
declare function after(description: string, action: ActionFunction): void;
58+
declare function beforeEach(action: ActionFunction): void;
59+
declare function beforeEach(description: string, action: ActionFunction): void;
60+
declare function afterEach(action: ActionFunction): void;
61+
declare function afterEach(description: string, action: ActionFunction): void;
62+
63+
declare class Mocha {
64+
currentTest: Mocha.ITestDefinition;
65+
constructor(options?: {
66+
grep?: RegExp;
67+
ui?: string;
68+
reporter?: string;
69+
timeout?: number;
70+
bail?: boolean;
71+
});
72+
73+
/** Setup mocha with the given options. */
74+
setup(options: MochaSetupOptions): Mocha;
75+
bail(value?: boolean): Mocha;
76+
addFile(file: string): Mocha;
77+
/** Sets reporter by name, defaults to "spec". */
78+
reporter(name: string): Mocha;
79+
/** Sets reporter constructor, defaults to mocha.reporters.Spec. */
80+
reporter(reporter: (runner: Mocha.IRunner, options: any) => any): Mocha;
81+
ui(value: string): Mocha;
82+
grep(value: string): Mocha;
83+
grep(value: RegExp): Mocha;
84+
invert(): Mocha;
85+
ignoreLeaks(value: boolean): Mocha;
86+
checkLeaks(): Mocha;
87+
/**
88+
* Function to allow assertion libraries to throw errors directly into mocha.
89+
* This is useful when running tests in a browser because window.onerror will
90+
* only receive the 'message' attribute of the Error.
91+
*/
92+
throwError(error: Error): void;
93+
/** Enables growl support. */
94+
growl(): Mocha;
95+
globals(value: string): Mocha;
96+
globals(values: string[]): Mocha;
97+
useColors(value: boolean): Mocha;
98+
useInlineDiffs(value: boolean): Mocha;
99+
timeout(value: number): Mocha;
100+
slow(value: number): Mocha;
101+
enableTimeouts(value: boolean): Mocha;
102+
asyncOnly(value: boolean): Mocha;
103+
noHighlighting(value: boolean): Mocha;
104+
/** Runs tests and invokes `onComplete()` when finished. */
105+
run(onComplete?: (failures: number) => void): Mocha.IRunner;
106+
}
107+
108+
// merge the Mocha class declaration with a module
109+
declare namespace Mocha {
110+
/** Partial interface for Mocha's `Runnable` class. */
111+
interface IRunnable {
112+
title: string;
113+
fn: Function;
114+
async: boolean;
115+
sync: boolean;
116+
timedOut: boolean;
117+
}
118+
119+
/** Partial interface for Mocha's `Suite` class. */
120+
interface ISuite {
121+
parent: ISuite;
122+
title: string;
123+
124+
fullTitle(): string;
125+
}
126+
127+
/** Partial interface for Mocha's `Test` class. */
128+
interface ITest extends IRunnable {
129+
parent: ISuite;
130+
pending: boolean;
131+
132+
fullTitle(): string;
133+
}
134+
135+
/** Partial interface for Mocha's `Runner` class. */
136+
interface IRunner {}
137+
138+
interface IContextDefinition {
139+
(description: string, spec: () => void): ISuite;
140+
only(description: string, spec: () => void): ISuite;
141+
skip(description: string, spec: () => void): void;
142+
timeout(ms: number): void;
143+
}
144+
145+
interface ITestDefinition {
146+
(expectation: string, assertion?: ActionFunction): ITest;
147+
only(expectation: string, assertion?: ActionFunction): ITest;
148+
skip(expectation: string, assertion?: ActionFunction): void;
149+
timeout(ms: number): void;
150+
state: "failed" | "passed";
151+
}
152+
153+
export module reporters {
154+
export class Base {
155+
stats: {
156+
suites: number;
157+
tests: number;
158+
passes: number;
159+
pending: number;
160+
failures: number;
161+
};
162+
163+
constructor(runner: IRunner);
164+
}
165+
166+
export class Doc extends Base {}
167+
export class Dot extends Base {}
168+
export class HTML extends Base {}
169+
export class HTMLCov extends Base {}
170+
export class JSON extends Base {}
171+
export class JSONCov extends Base {}
172+
export class JSONStream extends Base {}
173+
export class Landing extends Base {}
174+
export class List extends Base {}
175+
export class Markdown extends Base {}
176+
export class Min extends Base {}
177+
export class Nyan extends Base {}
178+
export class Progress extends Base {
179+
/**
180+
* @param options.open String used to indicate the start of the progress bar.
181+
* @param options.complete String used to indicate a complete test on the progress bar.
182+
* @param options.incomplete String used to indicate an incomplete test on the progress bar.
183+
* @param options.close String used to indicate the end of the progress bar.
184+
*/
185+
constructor(runner: IRunner, options?: {
186+
open?: string;
187+
complete?: string;
188+
incomplete?: string;
189+
close?: string;
190+
});
191+
}
192+
export class Spec extends Base {}
193+
export class TAP extends Base {}
194+
export class XUnit extends Base {
195+
constructor(runner: IRunner, options?: any);
196+
}
197+
}
198+
}
199+
200+
declare module "mocha" {
201+
export = Mocha;
202+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"resolution": "main",
3+
"tree": {
4+
"src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/a361a8ab3c327f208d3f82ad206971d4a63d8c25/mocha/mocha.d.ts",
5+
"raw": "registry:dt/mocha#2.2.5+20160720003353",
6+
"typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/a361a8ab3c327f208d3f82ad206971d4a63d8c25/mocha/mocha.d.ts"
7+
}
8+
}

0 commit comments

Comments
 (0)