Skip to content

Commit c8e1696

Browse files
authored
Merge branch 'dev' into issues-469
2 parents 8cec974 + 4ad234c commit c8e1696

File tree

6 files changed

+137
-143
lines changed

6 files changed

+137
-143
lines changed
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
name: Docker Tests
1+
# Tests that require access to a cloud JFrog platform instance
2+
name: Cloud Instance Tests
23
on:
34
push:
45
branches:
@@ -13,7 +14,7 @@ concurrency:
1314
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.ref }}
1415
cancel-in-progress: true
1516
jobs:
16-
Docker-Tests:
17+
Cloud-Tests:
1718
if: contains(github.event.pull_request.labels.*.name, 'safe to test') || github.event_name == 'push'
1819
runs-on: ubuntu-latest
1920
steps:
@@ -31,4 +32,4 @@ jobs:
3132
ADO_JFROG_PLATFORM_URL: ${{ secrets.PLATFORM_URL }}
3233
ADO_JFROG_PLATFORM_ACCESS_TOKEN: ${{ secrets.PLATFORM_ADMIN_TOKEN }}
3334
ADO_JFROG_PLATFORM_DOCKER_DOMAIN: ${{ secrets.CONTAINER_REGISTRY }}
34-
ADO_SKIP_TESTS: unit,proxy,generic,installer,npm,maven,gradle,conan,nuget,dotnet,go,pip,distribution
35+
ADO_SKIP_TESTS: unit,proxy,generic,installer,npm,maven,gradle,conan,nuget,dotnet,go,pip

.github/workflows/distributionTests.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Tests that runs on a local Artifactory instance
12
name: Tests
23
on:
34
push:

tests/resources/docker/scan.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const { platformDockerDomain } = require('../../testUtils');
33

44
let inputs = {
55
command: 'Scan',
6-
imageName: `${platformDockerDomain}/docker-local/docker-test:1`,
6+
imageName: `${platformDockerDomain}/${testUtils.getRepoKeys().dockerLocalRepo}/docker-test:1`,
77
};
88

99
testUtils.runXrayTask(testUtils.docker, {}, inputs);

tests/testUtils.ts

Lines changed: 130 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const repoKeys: any = {
3939
pipRemoteRepo: 'pip-remote',
4040
pipVirtualRepo: 'pip-virtual',
4141
releaseBundlesRepo: 'rb-repo',
42+
dockerLocalRepo: 'docker-local'
4243
};
4344

4445
export { testDataDir, repoKeys, platformUrl, platformPassword, platformUsername, platformAccessToken, platformDockerDomain };
@@ -164,114 +165,138 @@ export function createTestRepositories(): void {
164165
url: 'https://releases.jfrog.io/artifactory/jfrog-cli/v2-jf',
165166
}),
166167
);
167-
createRepo(repoKeys.mavenLocalRepo, JSON.stringify({ rclass: 'local', packageType: 'maven' }));
168-
createRepo(
169-
repoKeys.mavenRemoteRepo,
170-
JSON.stringify({
171-
rclass: 'remote',
172-
packageType: 'maven',
173-
url: 'https://repo.maven.apache.org/maven2',
174-
}),
175-
);
176-
createRepo(
177-
repoKeys.nugetLocalRepo,
178-
JSON.stringify({
179-
rclass: 'local',
180-
packageType: 'nuget',
181-
repoLayoutRef: 'nuget-default',
182-
}),
183-
);
184-
createRepo(
185-
repoKeys.nugetRemoteRepo,
186-
JSON.stringify({
187-
rclass: 'remote',
188-
packageType: 'nuget',
189-
repoLayoutRef: 'nuget-default',
190-
downloadContextPath: 'api/v2/package',
191-
feedContextPath: 'api/v2',
192-
v3FeedUrl: 'https://api.nuget.org/v3/index.json',
193-
url: 'https://www.nuget.org/',
194-
}),
195-
);
196-
createRepo(
197-
repoKeys.nugetVirtualRepo,
198-
JSON.stringify({
199-
rclass: 'virtual',
200-
packageType: 'nuget',
201-
repoLayoutRef: 'nuget-default',
202-
repositories: [repoKeys.nugetRemoteRepo, repoKeys.nugetLocalRepo],
203-
}),
204-
);
205-
createRepo(
206-
repoKeys.npmLocalRepo,
207-
JSON.stringify({
208-
rclass: 'local',
209-
packageType: 'npm',
210-
repoLayoutRef: 'npm-default',
211-
}),
212-
);
213-
createRepo(
214-
repoKeys.npmRemoteRepo,
215-
JSON.stringify({
216-
rclass: 'remote',
217-
packageType: 'npm',
218-
repoLayoutRef: 'npm-default',
219-
url: 'https://registry.npmjs.org',
220-
}),
221-
);
222-
createRepo(
223-
repoKeys.npmVirtualRepo,
224-
JSON.stringify({
225-
rclass: 'virtual',
226-
packageType: 'npm',
227-
repoLayoutRef: 'npm-default',
228-
repositories: [repoKeys.npmLocalRepo, repoKeys.npmRemoteRepo],
229-
}),
230-
);
231-
createRepo(repoKeys.conanLocalRepo, JSON.stringify({ rclass: 'local', packageType: 'conan' }));
232-
createRepo(
233-
repoKeys.goLocalRepo,
234-
JSON.stringify({
235-
rclass: 'local',
236-
packageType: 'go',
237-
repoLayoutRef: 'go-default',
238-
}),
239-
);
240-
createRepo(
241-
repoKeys.goRemoteRepo,
242-
JSON.stringify({
243-
rclass: 'remote',
244-
packageType: 'go',
245-
repoLayoutRef: 'go-default',
246-
url: 'https://proxy.golang.org',
247-
}),
248-
);
249-
createRepo(
250-
repoKeys.goVirtualRepo,
251-
JSON.stringify({
252-
rclass: 'virtual',
253-
packageType: 'go',
254-
repoLayoutRef: 'go-default',
255-
repositories: [repoKeys.goLocalRepo, repoKeys.goRemoteRepo],
256-
}),
257-
);
258-
createRepo(repoKeys.pipLocalRepo, JSON.stringify({ rclass: 'local', packageType: 'pypi', repoLayoutRef: 'simple-default' }));
259-
createRepo(
260-
repoKeys.pipRemoteRepo,
261-
JSON.stringify({ rclass: 'remote', packageType: 'pypi', repoLayoutRef: 'simple-default', url: 'https://files.pythonhosted.org' }),
262-
);
263-
createRepo(
264-
repoKeys.pipVirtualRepo,
265-
JSON.stringify({
266-
rclass: 'virtual',
267-
packageType: 'pypi',
268-
repoLayoutRef: 'simple-default',
269-
repositories: [repoKeys.pipLocalRepo, repoKeys.pipRemoteRepo],
270-
}),
271-
);
168+
if (!isSkipTest('maven')) {
169+
createRepo(repoKeys.mavenLocalRepo, JSON.stringify({ rclass: 'local', packageType: 'maven' }));
170+
createRepo(
171+
repoKeys.mavenRemoteRepo,
172+
JSON.stringify({
173+
rclass: 'remote',
174+
packageType: 'maven',
175+
url: 'https://repo.maven.apache.org/maven2',
176+
}),
177+
);
178+
}
179+
if (!isSkipTest('nuget') && !isSkipTest('dotnet')) {
180+
createRepo(
181+
repoKeys.nugetLocalRepo,
182+
JSON.stringify({
183+
rclass: 'local',
184+
packageType: 'nuget',
185+
repoLayoutRef: 'nuget-default',
186+
}),
187+
);
188+
createRepo(
189+
repoKeys.nugetRemoteRepo,
190+
JSON.stringify({
191+
rclass: 'remote',
192+
packageType: 'nuget',
193+
repoLayoutRef: 'nuget-default',
194+
downloadContextPath: 'api/v2/package',
195+
feedContextPath: 'api/v2',
196+
v3FeedUrl: 'https://api.nuget.org/v3/index.json',
197+
url: 'https://www.nuget.org/',
198+
}),
199+
);
200+
createRepo(
201+
repoKeys.nugetVirtualRepo,
202+
JSON.stringify({
203+
rclass: 'virtual',
204+
packageType: 'nuget',
205+
repoLayoutRef: 'nuget-default',
206+
repositories: [repoKeys.nugetRemoteRepo, repoKeys.nugetLocalRepo],
207+
}),
208+
);
209+
}
210+
if (!isSkipTest('npm')) {
211+
createRepo(
212+
repoKeys.npmLocalRepo,
213+
JSON.stringify({
214+
rclass: 'local',
215+
packageType: 'npm',
216+
repoLayoutRef: 'npm-default',
217+
}),
218+
);
219+
createRepo(
220+
repoKeys.npmRemoteRepo,
221+
JSON.stringify({
222+
rclass: 'remote',
223+
packageType: 'npm',
224+
repoLayoutRef: 'npm-default',
225+
url: 'https://registry.npmjs.org',
226+
}),
227+
);
228+
createRepo(
229+
repoKeys.npmVirtualRepo,
230+
JSON.stringify({
231+
rclass: 'virtual',
232+
packageType: 'npm',
233+
repoLayoutRef: 'npm-default',
234+
repositories: [repoKeys.npmLocalRepo, repoKeys.npmRemoteRepo],
235+
}),
236+
);
237+
}
238+
if (!isSkipTest('conan')) {
239+
createRepo(repoKeys.conanLocalRepo, JSON.stringify({ rclass: 'local', packageType: 'conan' }));
240+
}
241+
if (!isSkipTest('go')) {
242+
createRepo(
243+
repoKeys.goLocalRepo,
244+
JSON.stringify({
245+
rclass: 'local',
246+
packageType: 'go',
247+
repoLayoutRef: 'go-default',
248+
}),
249+
);
250+
createRepo(
251+
repoKeys.goRemoteRepo,
252+
JSON.stringify({
253+
rclass: 'remote',
254+
packageType: 'go',
255+
repoLayoutRef: 'go-default',
256+
url: 'https://proxy.golang.org',
257+
}),
258+
);
259+
createRepo(
260+
repoKeys.goVirtualRepo,
261+
JSON.stringify({
262+
rclass: 'virtual',
263+
packageType: 'go',
264+
repoLayoutRef: 'go-default',
265+
repositories: [repoKeys.goLocalRepo, repoKeys.goRemoteRepo],
266+
}),
267+
);
268+
}
269+
if (!isSkipTest('pip')) {
270+
createRepo(repoKeys.pipLocalRepo, JSON.stringify({ rclass: 'local', packageType: 'pypi', repoLayoutRef: 'simple-default' }));
271+
createRepo(
272+
repoKeys.pipRemoteRepo,
273+
JSON.stringify({ rclass: 'remote', packageType: 'pypi', repoLayoutRef: 'simple-default', url: 'https://files.pythonhosted.org' }),
274+
);
275+
createRepo(
276+
repoKeys.pipVirtualRepo,
277+
JSON.stringify({
278+
rclass: 'virtual',
279+
packageType: 'pypi',
280+
repoLayoutRef: 'simple-default',
281+
repositories: [repoKeys.pipLocalRepo, repoKeys.pipRemoteRepo],
282+
}),
283+
);
284+
}
272285
if (!isSkipTest('distribution')) {
273286
createRepo(repoKeys.releaseBundlesRepo, JSON.stringify({ rclass: 'releaseBundles' }));
274287
}
288+
if (!isSkipTest('docker')) {
289+
createRepo(
290+
repoKeys.dockerLocalRepo,
291+
JSON.stringify({
292+
rclass: 'local',
293+
packageType: 'docker',
294+
dockerApiVersion: 'V2',
295+
dockerV1Enabled: false,
296+
enableTokenAuthentication: true
297+
}),
298+
);
299+
}
275300
}
276301

277302
/**

tests/tests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ describe('JFrog Artifactory Extension Tests', (): void => {
745745
const filesDir: string = TestUtils.isWindows() ? 'windowsFiles' : 'unixFiles';
746746

747747
// Run docker build + tag
748-
execSync(`docker build -t ${platformDockerDomain}/docker-local/docker-test:1 ${join(__dirname, 'resources', testDir, filesDir)}`);
748+
execSync(`docker build -t ${platformDockerDomain}/${repoKeys.dockerLocalRepo}/docker-test:1 ${join(__dirname, 'resources', testDir, filesDir)}`);
749749

750750
// run docker push
751751
mockTask(testDir, 'push');

0 commit comments

Comments
 (0)