Skip to content

Commit

Permalink
Merge branch '8.7' into backport/8.7/pr-150492
Browse files Browse the repository at this point in the history
  • Loading branch information
jeramysoucy authored Feb 9, 2023
2 parents 6f00bf3 + 061eed8 commit 20b53b0
Show file tree
Hide file tree
Showing 12 changed files with 112 additions and 11 deletions.
23 changes: 12 additions & 11 deletions x-pack/test/fleet_api_integration/apis/epm/install_prerelease.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ export default function (providerContext: FtrProviderContext) {
await supertest.delete(`/api/fleet/epm/packages/${pkg}/${version}`).set('kbn-xsrf', 'xxxx');
};

describe('installs package that has a prerelease version', async () => {
// Failing: See https://github.com/elastic/kibana/issues/150343
describe.skip('installs package that has a prerelease version', async () => {
skipIfNoDockerRegistry(providerContext);
setupFleetAndAgents(providerContext);

Expand All @@ -37,21 +38,21 @@ export default function (providerContext: FtrProviderContext) {
await supertest
.post(`/api/fleet/epm/packages/${testPackage}/${testPackageVersion}`)
.set('kbn-xsrf', 'xxxx')
.send({ force: true })
.expect(200);
});

const pkg = 'endpoint';
const gaVersion = '8.6.1';
const betaVersion = '8.7.0-next';
const gaVersion = '1.0.0';
const betaVersion = '1.0.1-next';

afterEach(async () => {
await deletePackage(pkg, gaVersion);
await deletePackage(pkg, betaVersion);
await deletePackage(testPackage, gaVersion);
await deletePackage(testPackage, betaVersion);
});

it('should install the GA package correctly', async function () {
const response = await supertest
.post(`/api/fleet/epm/packages/${pkg}/${gaVersion}`)
.post(`/api/fleet/epm/packages/${testPackage}/${gaVersion}`)
.set('kbn-xsrf', 'xxxx')
.send({ force: true })
.expect(200);
Expand All @@ -61,7 +62,7 @@ export default function (providerContext: FtrProviderContext) {

it('should install the GA package when no version is provided', async function () {
const response = await supertest
.post(`/api/fleet/epm/packages/${pkg}`)
.post(`/api/fleet/epm/packages/${testPackage}`)
.set('kbn-xsrf', 'xxxx')
.send({ force: true })
.expect(200);
Expand All @@ -71,7 +72,7 @@ export default function (providerContext: FtrProviderContext) {

it('should install the beta package when no version is provided and prerelease is true', async function () {
const response = await supertest
.post(`/api/fleet/epm/packages/${pkg}?prerelease=true`)
.post(`/api/fleet/epm/packages/${testPackage}?prerelease=true`)
.set('kbn-xsrf', 'xxxx')
.send({ force: true }) // using force to ignore package verification error
.expect(200);
Expand All @@ -83,7 +84,7 @@ export default function (providerContext: FtrProviderContext) {
const response = await supertest
.post(`/api/fleet/epm/packages/_bulk?prerelease=true`)
.set('kbn-xsrf', 'xxxx')
.send({ packages: ['endpoint'], force: true })
.send({ packages: ['prerelease'], force: true })
.expect(200);

expect(response.body.items[0].version).equal(betaVersion);
Expand All @@ -93,7 +94,7 @@ export default function (providerContext: FtrProviderContext) {
const response = await supertest
.post(`/api/fleet/epm/packages/_bulk`)
.set('kbn-xsrf', 'xxxx')
.send({ packages: ['endpoint'], force: true })
.send({ packages: ['prerelease'], force: true })
.expect(200);

expect(response.body.items[0].version).equal(gaVersion);
Expand Down
Binary file not shown.
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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
title: Test Dataset

type: logs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Test package

For testing a prerelease package
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
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: 1.0.0
categories: ['security']
type: integration
license: basic
owner:
github: elastic/fleet

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'
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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
title: Test Dataset

type: logs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Test package

For testing a prerelease package
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
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: 1.0.1-next
categories: ['security']
type: integration
license: basic
owner:
github: elastic/fleet

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'

0 comments on commit 20b53b0

Please sign in to comment.