Skip to content

Commit 0e98812

Browse files
authored
fix: fix failing tests (#695)
* fix: update centos stream 10 sha * fix: mock binaryExists to fix test issues * chore: typos in tests
1 parent cd27502 commit 0e98812

File tree

6 files changed

+591
-531
lines changed

6 files changed

+591
-531
lines changed

test/system/operating-systems/__snapshots__/centos6.spec.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`CentOS 7 tests can scan a centos6-based image 1`] = `
3+
exports[`CentOS 6 tests can scan a centos6-based image 1`] = `
44
Object {
55
"scanResults": Array [
66
Object {
@@ -3240,7 +3240,7 @@ Object {
32403240
}
32413241
`;
32423242

3243-
exports[`CentOS 7 tests can scan a centos6-based image with app vulns 1`] = `
3243+
exports[`CentOS 6 tests can scan a centos6-based image with app vulns 1`] = `
32443244
Object {
32453245
"scanResults": Array [
32463246
Object {

test/system/operating-systems/__snapshots__/centos7.spec.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`centos tests should correctly analyze a centos image by sha256 1`] = `
3+
exports[`CentOS 7 tests should correctly analyze a centos image by sha256 1`] = `
44
Object {
55
"scanResults": Array [
66
Object {
@@ -2452,7 +2452,7 @@ Object {
24522452
}
24532453
`;
24542454

2455-
exports[`centos tests should correctly analyze a centos image by tag 1`] = `
2455+
exports[`CentOS 7 tests should correctly analyze a centos image by tag 1`] = `
24562456
Object {
24572457
"scanResults": Array [
24582458
Object {

test/system/operating-systems/centos6.spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { scan } from "../../../lib";
2+
import { Docker } from "../../../lib/docker";
23
import { execute } from "../../../lib/sub-process";
34

4-
describe("CentOS 7 tests", () => {
5+
describe("CentOS 6 tests", () => {
56
afterAll(async () => {
67
await execute("docker", [
78
"image",
@@ -18,6 +19,7 @@ describe("CentOS 7 tests", () => {
1819

1920
const pluginResponse = await scan({
2021
path: imagePath,
22+
platform: "linux/amd64",
2123
"exclude-app-vulns": true,
2224
});
2325
expect(pluginResponse).toMatchSnapshot();
@@ -29,6 +31,7 @@ describe("CentOS 7 tests", () => {
2931

3032
const pluginResponse = await scan({
3133
path: imagePath,
34+
platform: "linux/amd64",
3235
});
3336
expect(pluginResponse).toMatchSnapshot();
3437
});

test/system/operating-systems/centos7.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { scan } from "../../../lib/index";
22
import { execute } from "../../../lib/sub-process";
33

4-
describe("centos tests", () => {
4+
describe("CentOS 7 tests", () => {
55
afterAll(async () => {
66
await execute("docker", ["image", "rm", "centos:7.8.2003"]).catch(() => {
77
console.error(`tests teardown failed to remove docker image`);

0 commit comments

Comments
 (0)