Skip to content

Commit

Permalink
[Flaky test elastic#131192] HTTP SSL Redirects (elastic#163726)
Browse files Browse the repository at this point in the history
  • Loading branch information
afharo authored Aug 14, 2023
1 parent 0ce9d33 commit 2611863
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .buildkite/ftr_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ enabled:
- test/plugin_functional/config.ts
- test/server_integration/http/platform/config.status.ts
- test/server_integration/http/platform/config.ts
- test/server_integration/http/ssl_redirect/config.js
- test/server_integration/http/ssl_redirect/config.ts
- test/server_integration/http/ssl_with_p12_intermediate/config.js
- test/server_integration/http/ssl_with_p12/config.js
- test/server_integration/http/ssl/config.js
Expand Down
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,7 @@ module.exports = {
'test/*/config_open.ts',
'test/*/*.config.ts',
'test/*/{tests,test_suites,apis,apps}/**/*',
'test/server_integration/**/*.ts',
'x-pack/test/*/{tests,test_suites,apis,apps}/**/*',
'x-pack/test/*/*config.*ts',
'x-pack/test/saved_object_api_integration/*/apis/**/*',
Expand Down
2 changes: 1 addition & 1 deletion test/server_integration/http/platform/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import { FtrProviderContext } from '../../services/types';
// eslint-disable-next-line import/no-default-export

export default function ({ getService }: FtrProviderContext) {
const supertest = getService('supertest');

Expand Down
1 change: 0 additions & 1 deletion test/server_integration/http/platform/config.status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { FtrConfigProviderContext, findTestPluginPaths } from '@kbn/test';
* and installing plugins against built Kibana. This test must be run against source only in order to build the
* fixture plugins
*/
// eslint-disable-next-line import/no-default-export
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const httpConfig = await readConfigFile(require.resolve('../../config.base.js'));

Expand Down
1 change: 0 additions & 1 deletion test/server_integration/http/platform/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import { FtrConfigProviderContext } from '@kbn/test';

// eslint-disable-next-line import/no-default-export
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const httpConfig = await readConfigFile(require.resolve('../../config.base.js'));

Expand Down
1 change: 0 additions & 1 deletion test/server_integration/http/platform/headers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { FtrProviderContext } from '../../services/types';
const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
const oneSec = 1_000;

// eslint-disable-next-line import/no-default-export
export default function ({ getService }: FtrProviderContext) {
const config = getService('config');

Expand Down
1 change: 0 additions & 1 deletion test/server_integration/http/platform/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { FtrProviderContext } from '../../services/types';

type ServiceStatusSerialized = Omit<ServiceStatus, 'level'> & { level: string };

// eslint-disable-next-line import/no-default-export
export default function ({ getService }: FtrProviderContext) {
const supertest = getService('supertest');
const retry = getService('retry');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
import Url from 'url';
import { readFileSync } from 'fs';
import { CA_CERT_PATH, KBN_CERT_PATH, KBN_KEY_PATH } from '@kbn/dev-utils';
import { FtrConfigProviderContext } from '@kbn/test';

import { createKibanaSupertestProvider } from '../../services';

export default async function ({ readConfigFile }) {
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const httpConfig = await readConfigFile(require.resolve('../../config.base.js'));
const certificateAuthorities = [readFileSync(CA_CERT_PATH)];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,23 @@
* Side Public License, v 1.
*/

export default function ({ getService }) {
import { FtrProviderContext } from '../../services/types';

export default function ({ getService }: FtrProviderContext) {
const supertest = getService('supertest');

// Failing: See https://github.com/elastic/kibana/issues/131192
// Failing: See https://github.com/elastic/kibana/issues/131192
describe.skip('kibana server with ssl', () => {
describe('kibana server with ssl', () => {
it('redirects http requests at redirect port to https', async () => {
const host = process.env.TEST_KIBANA_HOST || 'localhost';
const port = process.env.TEST_KIBANA_PORT || '5620';
const url = `https://${host}:${port}/`;

await supertest.get('/').expect('location', url).expect(302);
});

// Skips because the current version of supertest cannot follow redirects
// Can be unskipped once https://github.com/elastic/kibana/pull/163716 is merged
it.skip('does not boot-loop (2nd redirect points to the landing page)', async () => {
await supertest.get('/').redirects(1).expect('location', '/spaces/enter').expect(302);
});
});
Expand Down

0 comments on commit 2611863

Please sign in to comment.