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

[FTR] move supertestWithoutAuth service to kbn-ftr-common-functional-services #189613

Conversation

dmlemeshko
Copy link
Member

@dmlemeshko dmlemeshko commented Jul 31, 2024

Summary

While working on #188737 I had to move supertestWithoutAuth into kbn-ftr-common-functional-services package. This change seems to be bigger than initially planned.

Moving it to the separate PR with following changes:

  • move FTR SupertestWithoutAuthProvider service to package
  • remove "duplicates" in favour of service from package
  • update service type where needed

@dmlemeshko
Copy link
Member Author

/ci

@dmlemeshko
Copy link
Member Author

/ci

… github.com:dmlemeshko/kibana into ftr/supertestWithoutAuth-to-common-services-package
@dmlemeshko
Copy link
Member Author

/ci

@dmlemeshko dmlemeshko added release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting FTR v8.16.0 labels Jul 31, 2024
@dmlemeshko
Copy link
Member Author

/ci

.post('/api/console/proxy?method=GET&path=/.kibana/_settings')
.set('kbn-xsrf', 'true')
.set(svlCommonApi.getInternalRequestHeader())
.set(roleAuthc.apiKeyHeader)
.then((response) => {
Copy link
Member Author

@dmlemeshko dmlemeshko Jul 31, 2024

Choose a reason for hiding this comment

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

Solving Parameter 'response' implicitly has an 'any' type.

Alternatively we can import Response type from supertest, but I believe we shouldn't import lib directly in test files. Open for discussion.

Comment on lines -16 to -20
supertest: kibanaApiIntegrationServices.supertest,
supertestWithoutAuth: apiIntegrationServices.supertestWithoutAuth,
retry: kibanaApiIntegrationServices.retry,
esArchiver: kibanaFunctionalServices.esArchiver,
kibanaServer: kibanaFunctionalServices.kibanaServer,
Copy link
Member Author

Choose a reason for hiding this comment

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

already loaded as part of commonServices


export const services = {
...commonServices,
supertestWithoutAuth: apiIntegrationServices.supertestWithoutAuth,
Copy link
Member Author

Choose a reason for hiding this comment

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

already loaded as part of commonServices

@@ -36,7 +34,6 @@ export const services = {
dataViewApi: DataViewApiProvider,
esSupertestWithoutAuth: EsSupertestWithoutAuthProvider,
infraOpsSourceConfiguration: InfraOpsSourceConfigurationProvider,
supertestWithoutAuth: SupertestWithoutAuthProvider,
Copy link
Member Author

Choose a reason for hiding this comment

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

already loaded as part of commonServices

@dmlemeshko
Copy link
Member Author

/ci

@dmlemeshko
Copy link
Member Author

/ci

@dmlemeshko
Copy link
Member Author

/ci

@@ -22,7 +23,7 @@ export default function createSpacesOnlySuite({ getService }: FtrProviderContext
expectConflictResponse,
expectRbacForbiddenResponse,
expectSolutionSpecifiedResult,
} = createTestSuiteFactory(esArchiver, supertestWithoutAuth);
} = createTestSuiteFactory(esArchiver, supertestWithoutAuth as unknown as SuperTest<any>);
Copy link
Member Author

Choose a reason for hiding this comment

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

I had to do it to avoid test re-write: SupertestWithoutAuthProviderType won't allow to call .auth(string,string) with undefined arguments. I tried to rewrite it, but 2 configs started to fail, so I decide against it.

@dmlemeshko dmlemeshko marked this pull request as ready for review August 2, 2024 17:02
@dmlemeshko dmlemeshko requested review from a team as code owners August 2, 2024 17:02
@dmlemeshko dmlemeshko requested a review from hop-dev August 2, 2024 17:02
Copy link
Member

@afharo afharo left a comment

Choose a reason for hiding this comment

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

Core changes LGTM

@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Aug 2, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

Copy link
Member

@marius-dr marius-dr left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@pmuellr pmuellr left a comment

Choose a reason for hiding this comment

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

ResponseOps changes LGTM

Copy link
Contributor

@davismcphee davismcphee left a comment

Choose a reason for hiding this comment

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

Data Discovery changes LGTM

Copy link
Member

@sabarasaba sabarasaba left a comment

Choose a reason for hiding this comment

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

@elastic/kibana-management changes lgtm

@dmlemeshko dmlemeshko enabled auto-merge (squash) August 5, 2024 08:12
Copy link
Contributor

@elena-shostak elena-shostak left a comment

Choose a reason for hiding this comment

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

LGTM!

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/ftr-common-functional-services 21 24 +3
Unknown metric groups

API count

id before after diff
@kbn/ftr-common-functional-services 36 39 +3

ESLint disabled line counts

id before after diff
@kbn/test-suites-serverless 2 1 -1

Total ESLint disabled count

id before after diff
@kbn/test-suites-serverless 3 2 -1

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@dmlemeshko dmlemeshko merged commit 477d07f into elastic:main Aug 5, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting FTR release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.