Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Flaky test #131192] HTTP SSL Redirects #163726

Merged
merged 2 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 () => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Being pedantically explicit, this 2nd check didn't test what the previous claimed (redirecting to the https port). That's why I split it to a different test.

Then, I found out the issue with the old library of supertest, and I had to skip it.

await supertest.get('/').redirects(1).expect('location', '/spaces/enter').expect(302);
});
});
Expand Down
Loading