Skip to content

Commit

Permalink
Removing test for same package upgraded multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-buttner committed Sep 21, 2020
1 parent 3d2a686 commit 7cb80e9
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions x-pack/test/ingest_manager_api_integration/apis/epm/bulk_upgrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,38 +56,38 @@ export default function (providerContext: FtrProviderContext) {
expect(entry.oldVersion).equal('0.1.0');
expect(entry.newVersion).equal('0.3.0');
});
it('should handle the same package multiple times for upgrade', async function () {
it('should return an error for packages that do not exist', async function () {
const { body }: { body: BulkInstallPackagesResponse } = await supertest
.post(`/api/ingest_manager/epm/packages/_bulk`)
.set('kbn-xsrf', 'xxxx')
.send({ packages: ['multiple_versions', 'multiple_versions'] })
.send({ packages: ['multiple_versions', 'blahblah'] })
.expect(200);
expect(body.response.length).equal(2);
expect(body.response[0].name).equal('multiple_versions');
let entry = body.response[0] as BulkInstallPackageInfo;
const entry = body.response[0] as BulkInstallPackageInfo;
expect(entry.oldVersion).equal('0.1.0');
expect(entry.newVersion).equal('0.3.0');

entry = body.response[1] as BulkInstallPackageInfo;
expect(entry.oldVersion).equal('0.3.0');
expect(entry.newVersion).equal('0.3.0');
expect(body.response[1].name).equal('multiple_versions');
const err = body.response[1] as IBulkInstallPackageError;
expect(err.statusCode).equal(404);
expect(body.response[1].name).equal('blahblah');
});
it('should return an error for packages that do not exist', async function () {
it('should upgrade multiple packages', async function () {
const { body }: { body: BulkInstallPackagesResponse } = await supertest
.post(`/api/ingest_manager/epm/packages/_bulk`)
.set('kbn-xsrf', 'xxxx')
.send({ packages: ['multiple_versions', 'blahblah'] })
.send({ packages: ['multiple_versions', 'overrides'] })
.expect(200);
expect(body.response.length).equal(2);
expect(body.response[0].name).equal('multiple_versions');
const entry = body.response[0] as BulkInstallPackageInfo;
let entry = body.response[0] as BulkInstallPackageInfo;
expect(entry.oldVersion).equal('0.1.0');
expect(entry.newVersion).equal('0.3.0');

const err = body.response[1] as IBulkInstallPackageError;
expect(err.statusCode).equal(404);
expect(body.response[1].name).equal('blahblah');
entry = body.response[1] as BulkInstallPackageInfo;
expect(entry.oldVersion).equal(null);
expect(entry.newVersion).equal('0.1.0');
expect(entry.name).equal('overrides');
});
});

Expand Down

0 comments on commit 7cb80e9

Please sign in to comment.