Skip to content

Commit

Permalink
[8.9] [Flaky test #131192] HTTP SSL Redirects (#163726) (#163846)
Browse files Browse the repository at this point in the history
# Backport

This will backport the following commits from `main` to `8.9`:
- [[Flaky test #131192] HTTP SSL Redirects
(#163726)](#163726)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Alejandro Fernández
Haro","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-08-14T16:48:45Z","message":"[Flaky
test #131192] HTTP SSL Redirects
(#163726)","sha":"261186313e93661c93e214b7dc9a26ba0aa5b749","branchLabelMapping":{"^v8.10.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Core","technical
debt","release_note:skip","backport:all-open","v8.10.0"],"number":163726,"url":"https://github.com/elastic/kibana/pull/163726","mergeCommit":{"message":"[Flaky
test #131192] HTTP SSL Redirects
(#163726)","sha":"261186313e93661c93e214b7dc9a26ba0aa5b749"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.10.0","labelRegex":"^v8.10.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/163726","number":163726,"mergeCommit":{"message":"[Flaky
test #131192] HTTP SSL Redirects
(#163726)","sha":"261186313e93661c93e214b7dc9a26ba0aa5b749"}}]}]
BACKPORT-->

Co-authored-by: Alejandro Fernández Haro <[email protected]>
  • Loading branch information
kibanamachine and afharo authored Aug 14, 2023
1 parent 63250f1 commit 7955df4
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 @@ -152,7 +152,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 7955df4

Please sign in to comment.