-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Ingest Manager] Allow prerelease in package version (#74452)
* Allow prerelease in version * Adding integration test for prerelease version of a package * Tests for invalid package key * Removing inter-test dependency
- Loading branch information
1 parent
09a6c9d
commit e26c754
Showing
15 changed files
with
190 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
x-pack/test/ingest_manager_api_integration/apis/epm/get.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { FtrProviderContext } from '../../../api_integration/ftr_provider_context'; | ||
import { warnAndSkipTest } from '../../helpers'; | ||
|
||
export default function ({ getService }: FtrProviderContext) { | ||
const log = getService('log'); | ||
const supertest = getService('supertest'); | ||
const dockerServers = getService('dockerServers'); | ||
const server = dockerServers.get('registry'); | ||
|
||
describe('EPM - get', () => { | ||
it('returns a 500 for a package key without a proper name', async function () { | ||
if (server.enabled) { | ||
await supertest.get('/api/ingest_manager/epm/packages/-0.1.0').expect(500); | ||
} else { | ||
warnAndSkipTest(this, log); | ||
} | ||
}); | ||
|
||
it('returns a 500 for a package key without a proper semver version', async function () { | ||
if (server.enabled) { | ||
await supertest.get('/api/ingest_manager/epm/packages/endpoint-0.1.0.1.2.3').expect(500); | ||
} else { | ||
warnAndSkipTest(this, log); | ||
} | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
x-pack/test/ingest_manager_api_integration/apis/epm/install_prerelease.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { FtrProviderContext } from '../../../api_integration/ftr_provider_context'; | ||
import { warnAndSkipTest } from '../../helpers'; | ||
|
||
export default function ({ getService }: FtrProviderContext) { | ||
const supertest = getService('supertest'); | ||
const dockerServers = getService('dockerServers'); | ||
const log = getService('log'); | ||
|
||
const testPackage = 'prerelease-0.1.0-dev.0+abc'; | ||
const server = dockerServers.get('registry'); | ||
|
||
const deletePackage = async (pkgkey: string) => { | ||
await supertest.delete(`/api/ingest_manager/epm/packages/${pkgkey}`).set('kbn-xsrf', 'xxxx'); | ||
}; | ||
|
||
describe('installs package that has a prerelease version', async () => { | ||
after(async () => { | ||
if (server.enabled) { | ||
// remove the package just in case it being installed will affect other tests | ||
await deletePackage(testPackage); | ||
} | ||
}); | ||
|
||
it('should install the package correctly', async function () { | ||
if (server.enabled) { | ||
await supertest | ||
.post(`/api/ingest_manager/epm/packages/${testPackage}`) | ||
.set('kbn-xsrf', 'xxxx') | ||
.expect(200); | ||
} else { | ||
warnAndSkipTest(this, log); | ||
} | ||
}); | ||
}); | ||
} |
16 changes: 16 additions & 0 deletions
16
...ion/apis/fixtures/test_packages/prerelease/0.1.0-dev.0+abc/dataset/test/fields/fields.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
- name: data_stream.type | ||
type: constant_keyword | ||
description: > | ||
Data stream type. | ||
- name: data_stream.dataset | ||
type: constant_keyword | ||
description: > | ||
Data stream dataset. | ||
- name: data_stream.namespace | ||
type: constant_keyword | ||
description: > | ||
Data stream namespace. | ||
- name: '@timestamp' | ||
type: date | ||
description: > | ||
Event timestamp. |
3 changes: 3 additions & 0 deletions
3
...egration/apis/fixtures/test_packages/prerelease/0.1.0-dev.0+abc/dataset/test/manifest.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
title: Test Dataset | ||
|
||
type: logs |
3 changes: 3 additions & 0 deletions
3
...tegration/apis/fixtures/test_packages/prerelease/0.1.0-dev.0+abc/docs/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Test package | ||
|
||
For testing a prerelease package |
7 changes: 7 additions & 0 deletions
7
...tures/test_packages/prerelease/0.1.0-dev.0+abc/img/logo_prerelease_64_color.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions
20
...nager_api_integration/apis/fixtures/test_packages/prerelease/0.1.0-dev.0+abc/manifest.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
format_version: 1.0.0 | ||
name: prerelease | ||
title: Prerelease package | ||
description: This is a test package for testing that parsing a prerelease version works | ||
version: 0.1.0-dev.0+abc | ||
categories: ['security'] | ||
release: beta | ||
type: integration | ||
license: basic | ||
|
||
requirement: | ||
elasticsearch: | ||
versions: '>7.7.0' | ||
kibana: | ||
versions: '>7.7.0' | ||
|
||
icons: | ||
- src: '/img/logo_prerelease_64_color.svg' | ||
size: '16x16' | ||
type: 'image/svg+xml' |