Skip to content

Commit

Permalink
Use default ES distribution for functional tests (#88737)
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
Tyler Smalley and kibanamachine authored Feb 8, 2021
1 parent 46feb76 commit b39ad86
Show file tree
Hide file tree
Showing 18 changed files with 44 additions and 33 deletions.
1 change: 0 additions & 1 deletion .ci/packer_cache_for_branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ source src/dev/ci_setup/setup.sh;

# download es snapshots
node scripts/es snapshot --download-only;
node scripts/es snapshot --license=oss --download-only;

# download reporting browsers
(cd "x-pack" && node ../node_modules/.bin/gulp downloadChromium);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export const schema = Joi.object()

esTestCluster: Joi.object()
.keys({
license: Joi.string().default('oss'),
license: Joi.string().default('basic'),
from: Joi.string().default('snapshot'),
serverArgs: Joi.array(),
serverEnvVars: Joi.object(),
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-test/src/legacy_es/legacy_es_test_cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function createLegacyEsTestCluster(options = {}) {
const {
port = esTestConfig.getPort(),
password = 'changeme',
license = 'oss',
license = 'basic',
log,
basePath = resolve(KIBANA_ROOT, '.es'),
esFrom = esTestConfig.getBuildFrom(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('migration v2', () => {
adjustTimeout: (t: number) => jest.setTimeout(t),
settings: {
es: {
license: oss ? 'oss' : 'trial',
license: 'trial',
dataArchive,
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe.skip('migration from 7.7.2-xpack with 100k objects', () => {
adjustTimeout: (t: number) => jest.setTimeout(600000),
settings: {
es: {
license: oss ? 'oss' : 'trial',
license: 'trial',
dataArchive,
},
},
Expand Down
4 changes: 2 additions & 2 deletions src/core/test_helpers/kbn_server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export function createTestServers({
adjustTimeout: (timeout: number) => void;
settings?: {
es?: {
license: 'oss' | 'basic' | 'gold' | 'trial';
license: 'basic' | 'gold' | 'trial';
[key: string]: any;
};
kbn?: {
Expand All @@ -208,7 +208,7 @@ export function createTestServers({
if (!adjustTimeout) {
throw new Error('adjustTimeout is required in order to avoid flaky tests');
}
const license = get(settings, 'es.license', 'oss');
const license = get(settings, 'es.license', 'basic');
const usersToBeAdded = get(settings, 'users', []);
if (usersToBeAdded.length > 0) {
if (license !== 'trial') {
Expand Down
2 changes: 0 additions & 2 deletions src/dev/ci_setup/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ yarn kbn bootstrap
###
echo " -- downloading es snapshot"
node scripts/es snapshot --download-only;
node scripts/es snapshot --license=oss --download-only;


###
### verify no git modifications
Expand Down
5 changes: 4 additions & 1 deletion test/api_integration/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ export default async function ({ readConfigFile }) {
junit: {
reportName: 'API Integration Tests',
},
esTestCluster: commonConfig.get('esTestCluster'),
esTestCluster: {
...functionalConfig.get('esTestCluster'),
serverArgs: ['xpack.security.enabled=false'],
},
kbnTestServer: {
...functionalConfig.get('kbnTestServer'),
serverArgs: [
Expand Down
4 changes: 1 addition & 3 deletions test/common/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ export default function () {
servers,

esTestCluster: {
license: 'oss',
from: 'snapshot',
serverArgs: [],
serverArgs: ['xpack.security.enabled=false'],
},

kbnTestServer: {
Expand Down
12 changes: 1 addition & 11 deletions test/common/services/deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,7 @@ export function DeploymentProvider({ getService }: FtrProviderContext) {
* Useful for functional testing in cloud environment
*/
async isOss() {
const baseUrl = this.getEsHostPort();
const username = config.get('servers.elasticsearch.username');
const password = config.get('servers.elasticsearch.password');
const response = await fetch(baseUrl + '/_xpack', {
method: 'get',
headers: {
'Content-Type': 'application/json',
Authorization: 'Basic ' + Buffer.from(username + ':' + password).toString('base64'),
},
});
return response.status !== 200;
return config.get('kbnTestServer.serverArgs').indexOf('--oss') > -1;
},

async isCloud(): Promise<boolean> {
Expand Down
5 changes: 4 additions & 1 deletion test/examples/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ export default async function ({ readConfigFile }) {
},
pageObjects: functionalConfig.get('pageObjects'),
servers: functionalConfig.get('servers'),
esTestCluster: functionalConfig.get('esTestCluster'),
esTestCluster: {
...functionalConfig.get('esTestCluster'),
serverArgs: ['xpack.security.enabled=false'],
},
apps: functionalConfig.get('apps'),
esArchiver: {
directory: path.resolve(__dirname, '../es_archives'),
Expand Down
6 changes: 4 additions & 2 deletions test/functional/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ export default async function ({ readConfigFile }) {

servers: commonConfig.get('servers'),

esTestCluster: commonConfig.get('esTestCluster'),

esTestCluster: {
...commonConfig.get('esTestCluster'),
serverArgs: ['xpack.security.enabled=false'],
},
kbnTestServer: {
...commonConfig.get('kbnTestServer'),
serverArgs: [
Expand Down
5 changes: 4 additions & 1 deletion test/plugin_functional/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
},
pageObjects: functionalConfig.get('pageObjects'),
servers: functionalConfig.get('servers'),
esTestCluster: functionalConfig.get('esTestCluster'),
esTestCluster: {
...functionalConfig.get('esTestCluster'),
serverArgs: ['xpack.security.enabled=false'],
},
apps: functionalConfig.get('apps'),
esArchiver: {
directory: path.resolve(__dirname, '../es_archives'),
Expand Down
5 changes: 4 additions & 1 deletion test/server_integration/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ export default async function ({ readConfigFile }) {
junit: {
reportName: 'Integration Tests',
},
esTestCluster: commonConfig.get('esTestCluster'),
esTestCluster: {
...functionalConfig.get('esTestCluster'),
serverArgs: ['xpack.security.enabled=false'],
},
kbnTestServer: {
...functionalConfig.get('kbnTestServer'),
serverArgs: [
Expand Down
5 changes: 4 additions & 1 deletion test/server_integration/http/ssl/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ export default async function ({ readConfigFile }) {
junit: {
reportName: 'Http SSL Integration Tests',
},
esTestCluster: httpConfig.get('esTestCluster'),
esTestCluster: {
...httpConfig.get('esTestCluster'),
serverArgs: ['xpack.security.enabled=false'],
},
kbnTestServer: {
...httpConfig.get('kbnTestServer'),
serverArgs: [
Expand Down
5 changes: 4 additions & 1 deletion test/server_integration/http/ssl_redirect/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ export default async function ({ readConfigFile }) {
junit: {
reportName: 'Http SSL Integration Tests',
},
esTestCluster: httpConfig.get('esTestCluster'),
esTestCluster: {
...httpConfig.get('esTestCluster'),
serverArgs: ['xpack.security.enabled=false'],
},
kbnTestServer: {
...httpConfig.get('kbnTestServer'),
serverArgs: [
Expand Down
5 changes: 4 additions & 1 deletion test/server_integration/http/ssl_with_p12/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ export default async function ({ readConfigFile }) {
junit: {
reportName: 'Http SSL Integration Tests',
},
esTestCluster: httpConfig.get('esTestCluster'),
esTestCluster: {
...httpConfig.get('esTestCluster'),
serverArgs: ['xpack.security.enabled=false'],
},
kbnTestServer: {
...httpConfig.get('kbnTestServer'),
serverArgs: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ export default async function ({ readConfigFile }) {
junit: {
reportName: 'Http SSL Integration Tests',
},
esTestCluster: httpConfig.get('esTestCluster'),
esTestCluster: {
...httpConfig.get('esTestCluster'),
serverArgs: ['xpack.security.enabled=false'],
},
kbnTestServer: {
...httpConfig.get('kbnTestServer'),
serverArgs: [
Expand Down

0 comments on commit b39ad86

Please sign in to comment.