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

[Fleet] Edit package policy tests #125068

Merged
merged 3 commits into from
Feb 10, 2022

Conversation

juliaElastic
Copy link
Contributor

Summary

Added unit tests for Edit package policy covering forceUpgrade flag too.
Related to #123819

@juliaElastic juliaElastic added release_note:skip Skip the PR/issue when compiling release notes auto-backport Deprecated - use backport:version if exact versions are needed v8.1.0 v8.2.0 labels Feb 9, 2022
@juliaElastic juliaElastic requested a review from a team as a code owner February 9, 2022 12:47
@juliaElastic juliaElastic self-assigned this Feb 9, 2022
@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Feb 9, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

* [observability-test-environments](https://github.com/elastic/observability-test-environments): internal project, uses Fleet API [Check here](https://github.com/elastic/observability-test-environments/blob/master/ansible/tasks-fleet-config.yml)
* [ECK](https://github.com/elastic/cloud-on-k8s): Elastic Cloud on Kubernetes, orchestrates Elastic Stack applications, including Kibana with Fleet (no direct dependency, has examples that include Fleet config) [Check here](https://github.com/elastic/cloud-on-k8s/blob/main/docs/orchestrating-elastic-stack-applications/agent-fleet.asciidoc)
* [APM Server](https://github.com/elastic/apm-server) APM Server, receives data from Elastic APM agents. Using docker compose for testing. [Check here](https://github.com/elastic/apm-server/pull/7227/files)
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 APM Server dependency to README

@@ -347,6 +347,8 @@ export const EditPackagePolicyForm = memo<{
: false;
if (!hasValidationErrors) {
setFormState('VALID');
} else {
setFormState('INVALID');
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 is actually a bugfix that create page had as well, form didn't become invalid when clearing a required form input

@@ -105,7 +105,8 @@ export const PackagePolicyInputConfig: React.FunctionComponent<{
<EuiFlexGroup direction="column" gutterSize="m">
{requiredVars.map((varDef) => {
const { name: varName, type: varType } = varDef;
const { value, frozen } = packagePolicyInput.vars![varName];
if (!packagePolicyInput.vars) return;
const { value, frozen } = packagePolicyInput.vars[varName];
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 these nullchecks as I kept getting js undefined errors while testing locally the upgrade page of aws. There is a short time initially when those variables are undefined, making the form unusable.

image

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Test Failures

  • [job] [logs] Default CI Group #18 / security APIs - Session Idle Session Idle cleanup should properly clean up session expired because of idle timeout

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
fleet 659.5KB 659.7KB +129.0B

History

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

cc @juliaElastic

Copy link
Contributor

@criamico criamico left a comment

Choose a reason for hiding this comment

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

LGTM

@juliaElastic juliaElastic merged commit f693a23 into elastic:main Feb 10, 2022
@juliaElastic juliaElastic deleted the edit-package-policy-tests branch February 10, 2022 11:45
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Feb 10, 2022
* edit package policy test

* moved out styled component, added null checks

* added tests for submit

(cherry picked from commit f693a23)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.1

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Feb 10, 2022
* edit package policy test

* moved out styled component, added null checks

* added tests for submit

(cherry picked from commit f693a23)

Co-authored-by: Julia Bardi <[email protected]>
kpollich added a commit to kpollich/kibana that referenced this pull request Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.1.0 v8.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants