Skip to content

Commit

Permalink
[FTR] Skipped basic license tests for FIPS (#208916)
Browse files Browse the repository at this point in the history
## Summary
All tests in
`deployment_agnostic/security_and_spaces/stateful.config_basic.ts` and
`deployment_agnostic/security_and_spaces/stateful.copy_to_space.config_basic.ts`
are intended to be run only with `basic` license, since FIPS overrides
it we need to skip that test for FIPS.

Separated index entries for `basic` and `trial` license, so tests with
trial config would still run.

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
elena-shostak and elasticmachine authored Jan 31, 2025
1 parent b62dff1 commit 9120c36
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,7 @@ export default function copyToSpaceSpacesAndSecuritySuite(
createMultiNamespaceTestCases,
} = copyToSpaceTestSuiteFactory(context);

const config = context.getService('config');
const license = config.get('esTestCluster.license');

describe('copy to spaces', function () {
if (license === 'basic') {
this.tags('skipFIPS');
}

[
{
spaceId: SPACES.DEFAULT.spaceId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,13 @@ import { createUsersAndRoles } from '../../../../common/lib/create_users_and_rol
import type { DeploymentAgnosticFtrProviderContext } from '../../../ftr_provider_context';

export default function ({ loadTestFile, getService }: DeploymentAgnosticFtrProviderContext) {
const config = getService('config');
const license = config.get('esTestCluster.license');
const es = getService('es');
const supertest = getService('supertest');
const isServerless = config.get('serverless');

describe('spaces api with security', function () {
// Should be enabled when custom roles can be provisioned for MKI
// See: https://github.com/elastic/kibana/issues/207361
this.tags('skipMKI');
this.tags('skipFIPS');
before(async () => {
if (license === 'basic' && !isServerless) {
await createUsersAndRoles(es, supertest);
}
await createUsersAndRoles(es, supertest);
});
loadTestFile(require.resolve('./copy_to_space'));
});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import type { DeploymentAgnosticFtrProviderContext } from '../../../ftr_provider_context';

export default function ({ loadTestFile, getService }: DeploymentAgnosticFtrProviderContext) {
describe('spaces api with security', function () {
// Should be enabled when custom roles can be provisioned for MKI
// See: https://github.com/elastic/kibana/issues/207361
this.tags('skipMKI');

loadTestFile(require.resolve('./copy_to_space'));
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,16 @@ import { createUsersAndRoles } from '../../../common/lib/create_users_and_roles'
import type { DeploymentAgnosticFtrProviderContext } from '../../ftr_provider_context';

export default function ({ loadTestFile, getService }: DeploymentAgnosticFtrProviderContext) {
const config = getService('config');
const license = config.get('esTestCluster.license');
const es = getService('es');
const supertest = getService('supertest');
// Should we enabled when custom roles can be provisioned for MKI
// See: https://github.com/elastic/kibana/issues/207361
const tags = ['skipMKI'];

if (license === 'basic') {
tags.push('skipFIPS');
}

describe('spaces api with security', function () {
this.tags(tags);
this.tags('skipFIPS');

before(async () => {
if (license === 'basic') {
await createUsersAndRoles(es, supertest);
}
await createUsersAndRoles(es, supertest);
});

loadTestFile(require.resolve('./resolve_copy_to_space_conflicts'));
loadTestFile(require.resolve('./create'));
loadTestFile(require.resolve('./delete'));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import type { DeploymentAgnosticFtrProviderContext } from '../../ftr_provider_context';

export default function ({ loadTestFile }: DeploymentAgnosticFtrProviderContext) {
describe('spaces api with security', function () {
this.tags('skipMKI');

loadTestFile(require.resolve('./resolve_copy_to_space_conflicts'));
loadTestFile(require.resolve('./create'));
loadTestFile(require.resolve('./delete'));
loadTestFile(require.resolve('./get_all'));
loadTestFile(require.resolve('./get'));
loadTestFile(require.resolve('./update'));
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default createServerlessTestConfig({
// @ts-expect-error roleScopedSupertest service accepts a user not just a user role and is different from the one in the common services
services,
serverlessProject: 'security',
testFiles: [require.resolve('./apis/copy_to_space')],
testFiles: [require.resolve('./apis/copy_to_space/index_trial')],
junit: {
reportName:
'X-Pack Spaces API Deployment Agnostic Integration Tests -- copy_to_space - serverless',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ import { createTestConfig } from '../../common/config';

export default createTestConfig('security_and_spaces - basic license', {
license: 'basic',
testFiles: [require.resolve('./apis')],
testFiles: [require.resolve('./apis/index_basic')],
});
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { services } from '../services';
export default createStatefulTestConfig({
// @ts-expect-error roleScopedSupertest service accepts a user not just a user role and is different from the one in the common services
services,
testFiles: [require.resolve('./apis')],
testFiles: [require.resolve('./apis/index_trial')],
junit: {
reportName:
'X-Pack Spaces API Deployment Agnostic Integration Tests -- security_and_spaces - trial license',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ import { createTestConfig } from '../../common/config';

export default createTestConfig('copy_to_space - basic license', {
license: 'basic',
testFiles: [require.resolve('./apis/copy_to_space')],
testFiles: [require.resolve('./apis/copy_to_space/index_basic')],
});
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { services } from '../services';
export default createStatefulTestConfig({
// @ts-expect-error roleScopedSupertest service accepts a user not just a user role and is different from the one in the common services
services,
testFiles: [require.resolve('./apis/copy_to_space')],
testFiles: [require.resolve('./apis/copy_to_space/index_trial')],
junit: {
reportName:
'X-Pack Spaces API Deployment Agnostic Integration Tests -- copy_to_space - trial license',
Expand Down

0 comments on commit 9120c36

Please sign in to comment.