Skip to content

[Spaces] Moved tests to agnostic setup#200606

Merged
elena-shostak merged 39 commits intoelastic:mainfrom
elena-shostak:space-deployment-agnostic
Jan 23, 2025
Merged

[Spaces] Moved tests to agnostic setup#200606
elena-shostak merged 39 commits intoelastic:mainfrom
elena-shostak:space-deployment-agnostic

Conversation

@elena-shostak
Copy link
Contributor

@elena-shostak elena-shostak commented Nov 18, 2024

Summary

Moved space tests to deployment agnostic setup.

Checklist

Closes: #194584

@elena-shostak
Copy link
Contributor Author

/ci

9 similar comments
@elena-shostak
Copy link
Contributor Author

/ci

@elena-shostak
Copy link
Contributor Author

/ci

@elena-shostak
Copy link
Contributor Author

/ci

@elena-shostak
Copy link
Contributor Author

/ci

@elena-shostak
Copy link
Contributor Author

/ci

@elena-shostak
Copy link
Contributor Author

/ci

@elena-shostak
Copy link
Contributor Author

/ci

@elena-shostak
Copy link
Contributor Author

/ci

@elena-shostak
Copy link
Contributor Author

/ci

@elena-shostak elena-shostak changed the title Moved tests to agnostic setup [Spaces] Moved tests to agnostic setup Nov 19, 2024
@elena-shostak elena-shostak added Team:Security Platform Security: Auth, Users, Roles, Spaces, Audit Logging, etc t// Feature:Security/Spaces Platform Security - Spaces feature FTR release_note:skip Skip the PR/issue when compiling release notes labels Nov 19, 2024
@elena-shostak elena-shostak force-pushed the space-deployment-agnostic branch from 8fedf64 to f6def7f Compare November 19, 2024 14:11
@elena-shostak
Copy link
Contributor Author

/ci

@azasypkin azasypkin self-requested a review November 19, 2024 16:02
@elena-shostak elena-shostak force-pushed the space-deployment-agnostic branch 2 times, most recently from 2df08a0 to 1464f66 Compare December 27, 2024 12:55
@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#7634

[❌] x-pack/test/spaces_api_integration/deployment_agnostic/stateful.config_trial.ts: 0/10 tests passed.

see run history

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#7635

[❌] x-pack/test/spaces_api_integration/deployment_agnostic/stateful.config_trial.ts: 0/1 tests passed.
[❌] x-pack/test/spaces_api_integration/deployment_agnostic/stateful.copy_to_space.config_basic.ts: 0/1 tests passed.
[❌] x-pack/test/spaces_api_integration/deployment_agnostic/stateful.copy_to_space.config_trial.ts: 0/1 tests passed.
[❌] x-pack/test/spaces_api_integration/deployment_agnostic/spaces_only/config.ts: 0/1 tests passed.
[❌] x-pack/test/spaces_api_integration/security_and_spaces/config_basic.ts: 0/1 tests passed.
[❌] x-pack/test/spaces_api_integration/security_and_spaces/config_trial.ts: 0/1 tests passed.

see run history

@elena-shostak
Copy link
Contributor Author

/ci

@elena-shostak
Copy link
Contributor Author

/сi

@elena-shostak elena-shostak force-pushed the space-deployment-agnostic branch 2 times, most recently from 06a8199 to e82dcfe Compare January 3, 2025 11:21
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Important

We have a shared test suite for basic/trial licenses, which includes tests for both authorized and unauthorized users. Decoupling these tests is a complex and time-consuming task that requires careful consideration to avoid ending up with a significant amount of duplicated test code for different licenses.

Our custom service for RoleScopedSupertest takes it into account license and user passed/not passed to adjust needed supertest accordingly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note

sharedtype changed to event-annotation-group SO
isolatedtype changed to url SO

I failed to change sharedtype to index-pattern SO type since I was getting a lot of missing references errors, probably it was due to the fact that index-pattern was migrated to the multiple namespace from 8.0.0

Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting. I wonder if they were just missing some information. There is an index pattern in the data file, and it contains this:

"migrationVersion": {
  "index-pattern": "8.0.0"
},

Copy link
Contributor Author

@elena-shostak elena-shostak Jan 3, 2025

Choose a reason for hiding this comment

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

agent.auth(this.user.username!, this.user.password!);

Needed to suppress the eslint error for this line in our custom test service, the promise is awaited in the tests itself and adding a catch block breaks some of the test cases

eslint-disable line gets removed because this rule runs dynamically

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note

Decided to not add complexity to the custom roleScopedSupertest to accommodate this use case, so made it in place.

Copy link
Contributor Author

@elena-shostak elena-shostak Jan 7, 2025

Choose a reason for hiding this comment

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

Note

There are no machine_learning_admin, machine_learning_user and monitoring_user roles in serverless.
We could rather move it to it's own test only for stateful or define custom roles, would like to have suggestions on this one 🙂

@elena-shostak elena-shostak force-pushed the space-deployment-agnostic branch from 5e7de03 to 23bc295 Compare January 21, 2025 10:43
@elena-shostak
Copy link
Contributor Author

@jeramysoucy won't this.tags(['skipMKI']); work for us?

Yes, that should work. Are we using this? I couldn't find it in the test suite.

Added in 23bc295

Copy link
Contributor

@wayneseymour wayneseymour left a comment

Choose a reason for hiding this comment

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

One question...

} = copyToSpaceTestSuiteFactory(context);

describe('copy to spaces', () => {
this.tags('skipMKI');
Copy link
Contributor

Choose a reason for hiding this comment

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

Hello there, what's the reason for these 4 skip on mki tags?
I ask as this PR is about being agnostic but it looks liek 4 suites are not agnostic.
Is there an issue on this already?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test suite uses custom roles and custom roles cannot be provisioned for MKI in the FTR yet.
That was agreed that we would disable it for now

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, so can we have a link to the issue for this just above this line?
If not, I'm afraid it will never be followed-up and remain skipped.

We've way too many test gaps already :(

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will link the issue in the comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added in 2bd07ce

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@wayneseymour is there anything else? I'm waiting only for your approval 🙂

Copy link
Contributor

@jeramysoucy jeramysoucy left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the updates!

@wayneseymour wayneseymour self-requested a review January 23, 2025 12:04
Copy link
Contributor

@wayneseymour wayneseymour left a comment

Choose a reason for hiding this comment

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

thanks!

@elena-shostak
Copy link
Contributor Author

@elasticmachine merge upstream

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #19 / useGetCaseConnectors shows a toast error message when an error occurs in the response

Metrics [docs]

Unknown metric groups

ESLint disabled line counts

id before after diff
@kbn/test-suites-xpack 743 727 -16

Total ESLint disabled count

id before after diff
@kbn/test-suites-xpack 768 752 -16

History

@elena-shostak elena-shostak merged commit ac5366a into elastic:main Jan 23, 2025
8 checks passed
viduni94 pushed a commit to viduni94/kibana that referenced this pull request Jan 23, 2025
## Summary

Moved space tests to deployment agnostic setup.


### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

__Closes: https://github.com/elastic/kibana/issues/194584__

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
JoseLuisGJ pushed a commit to JoseLuisGJ/kibana that referenced this pull request Jan 27, 2025
## Summary

Moved space tests to deployment agnostic setup.


### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

__Closes: https://github.com/elastic/kibana/issues/194584__

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting Feature:Security/Spaces Platform Security - Spaces feature FTR release_note:skip Skip the PR/issue when compiling release notes Team:Security Platform Security: Auth, Users, Roles, Spaces, Audit Logging, etc t// v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Leverage deployment agnostic SamlAuthProvider for Spaces API tests

8 participants