Skip to content

Commit

Permalink
Merge pull request #70 from snyk/develop
Browse files Browse the repository at this point in the history
Merge develop into master for release
  • Loading branch information
maxjeffos authored Aug 26, 2020
2 parents 39c3c37 + b741487 commit c253c12
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 deletions.
4 changes: 4 additions & 0 deletions ops/deploy/test-builds.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@
{
"projectName": "goof_windows",
"buildDefinitionId": 10
},
{
"projectName": "azure-maven-multimodule-goof",
"buildDefinitionId": 16
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const answers: ma.TaskLibAnswers = {
code: 0,
stdout: "Snyk CLI authorized!"
},
"/usr/bin/snyk test --docker myImage --file=Dockerfile --someAdditionalArgs --json-file-output=report.json": {
"/usr/bin/snyk test --docker myImage --file=Dockerfile --json-file-output=report.json --someAdditionalArgs": {
code: 0,
stdout: "No issues found"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const answers: ma.TaskLibAnswers = {
code: 0,
stdout: "No issues found"
},
"/usr/bin/snyk test --someAdditionalArgs --json-file-output=report.json": {
"/usr/bin/snyk test --json-file-output=report.json --someAdditionalArgs": {
code: 0,
stdout: "No issues found"
},
Expand Down
4 changes: 2 additions & 2 deletions snykTask/src/__tests__/task-lib.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ test("getOptionsToExecuteSnyk builds IExecOptions like we need it", () => {
});

test("getOptionsToExecuteSnykCLICommand builds IExecOptions like we need it", () => {
const taskNameForAnalytics = "snyk-azure-pipelines-task";
const taskNameForAnalytics = "AZURE_PIPELINES";
const version = "1.2.3";

const taskArgs: TaskArgs = new TaskArgs();
Expand All @@ -42,7 +42,7 @@ test("getOptionsToExecuteSnykCLICommand builds IExecOptions like we need it", ()
expect(options.cwd).toBe("/some/path");
expect(options.failOnStdErr).toBe(false);
expect(options.ignoreReturnCode).toBe(true);
expect(options.env?.SNYK_INTEGRATION_NAME).toBe("snyk-azure-pipelines-task");
expect(options.env?.SNYK_INTEGRATION_NAME).toBe("AZURE_PIPELINES");
expect(options.env?.SNYK_INTEGRATION_VERSION).toBe(version);
});

Expand Down
4 changes: 2 additions & 2 deletions snykTask/src/__tests__/test-task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ test("basic smoke test - inputs are ok", () => {
);
expect(
mockTestRunner.cmdlines[
"/usr/bin/snyk test --someAdditionalArgs --json-file-output=report.json"
"/usr/bin/snyk test --json-file-output=report.json --someAdditionalArgs"
]
).toBe(true);
expect(mockTestRunner.cmdlines["/usr/bin/snyk-to-html -i report.json"]).toBe(
Expand Down Expand Up @@ -70,7 +70,7 @@ test("basic smoke test for container test - inputs are ok", () => {
);
expect(
mockTestRunner.cmdlines[
"/usr/bin/snyk test --docker myImage --file=Dockerfile --someAdditionalArgs --json-file-output=report.json"
"/usr/bin/snyk test --docker myImage --file=Dockerfile --json-file-output=report.json --someAdditionalArgs"
]
).toBe(true);
expect(mockTestRunner.cmdlines["/usr/bin/snyk-to-html -i report.json"]).toBe(
Expand Down
8 changes: 4 additions & 4 deletions snykTask/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const SNYK_MONITOR_EXIT_CODE_SUCCESS = 0;
const SNYK_MONITOR_EXIT_INVALID_FILE_OR_IMAGE = 2;
const regexForRemoveCommandLine = /\[command\].*/g;

const taskNameForAnalytics = "snyk-azure-pipelines-task";
const taskNameForAnalytics = "AZURE_PIPELINES";
const taskJsonPath = path.join(__dirname, "..", "task.json");
const taskVersion = getTaskVersion(taskJsonPath);

Expand Down Expand Up @@ -137,7 +137,7 @@ async function installSnyk(
console.log(`installSnykExitCode: ${installSnykExitCode}\n`);
const snykOutput: SnykOutput = {
code: installSnykExitCode,
message: "Not possible install snyk and snky-to-html packages"
message: "Not possible to install snyk and snyk-to-html packages"
};

return snykOutput;
Expand Down Expand Up @@ -183,8 +183,8 @@ async function runSnykTest(
.argIf(taskArgs.dockerImageName, `--docker`)
.argIf(taskArgs.dockerImageName, `${taskArgs.dockerImageName}`)
.argIf(fileArg, `--file=${fileArg}`)
.line(taskArgs.additionalArguments)
.arg(`--json-file-output=${jsonReportOutputPath}`);
.arg(`--json-file-output=${jsonReportOutputPath}`)
.line(taskArgs.additionalArguments);

const options = getOptionsToExecuteSnykCLICommand(
taskArgs,
Expand Down

0 comments on commit c253c12

Please sign in to comment.