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

[Security Solution] Fix metadata tests with updated timestamps #115591

Merged

Conversation

kevinlog
Copy link
Contributor

Summary

Update the timestamps to fix the metadata tests and unskip them.

fixes: #106051

Note that we are moving away from this testing method of relying on a hardcoded timestamp. We have removed a portion of those dependencies, but a few still remain. We have an open ticket to remove the rest.

Checklist

Delete any items that are not applicable to this PR.

@kevinlog kevinlog requested a review from a team as a code owner October 19, 2021 15:36
@kevinlog
Copy link
Contributor Author

@elasticmachine merge upstream

@kevinlog kevinlog added the Team:Defend Workflows “EDR Workflows” sub-team of Security Solution label Oct 20, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-onboarding-and-lifecycle-mgt (Team:Onboarding and Lifecycle Mgt)

@kibanamachine
Copy link
Contributor

kibanamachine commented Oct 20, 2021

💔 Build Failed

Failed CI Steps


Test Failures

Kibana Pipeline / jest / Jest Tests.x-pack/plugins/security/public/management/users/edit_user.EditUserPage changes password of other user when submitting form and closes dialog

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has failed 1 times on tracked branches: https://github.com/elastic/kibana/issues/115473


Stack Trace

Error: thrown: "Exceeded timeout of 5000 ms for a test.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."
    at /var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/x-pack/plugins/security/public/management/users/edit_user/edit_user_page.test.tsx:215:3
    at _dispatchDescribe (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/index.js:67:26)
    at describe (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/index.js:30:5)
    at Object.<anonymous> (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/x-pack/plugins/security/public/management/users/edit_user/edit_user_page.test.tsx:37:1)
    at Runtime._execModule (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-runtime/build/index.js:1299:24)
    at Runtime._loadModule (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-runtime/build/index.js:898:12)
    at Runtime.requireModule (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-runtime/build/index.js:746:10)
    at jestAdapter (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:106:13)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at runTestInternal (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-runner/build/runTest.js:380:16)
    at runTest (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-runner/build/runTest.js:472:34)
    at Object.worker (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-runner/build/testWorker.js:133:12)

Kibana Pipeline / jest / Jest Tests.x-pack/plugins/security/public/management/users/edit_user.EditUserPage validates change password form

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has failed 1 times on tracked branches: https://github.com/elastic/kibana/issues/115474


Stack Trace

Error: Unable to find an element with the text: /Enter your current password/i. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.

<div
  data-eui="EuiFlyout"
  role="dialog"
>
  <button
    data-test-subj="euiFlyoutCloseButton"
    type="button"
  />
  <div
    class="euiFlyoutHeader euiFlyoutHeader--hasBorder"
  >
    <h2
      class="euiTitle euiTitle--medium"
      id="id-0.15851764918384426"
    >
      Change password
    </h2>
  </div>
  <div
    class="euiFlyoutBody"
  >
    <div
      class="euiFlyoutBody__overflow"
      tabindex="0"
    >
      <div
        class="euiFlyoutBody__overflowContent"
      >
        <form
          class="euiForm"
          novalidate=""
        >
          <div
            class="euiFormRow"
            id="id-0.8102490791961936-row"
          >
            <div
              class="euiFormRow__labelWrapper"
            >
              <label
                class="euiFormLabel euiFormRow__label"
                for="id-0.8102490791961936"
              >
                User
              </label>
            </div>
            <div
              class="euiFormRow__fieldWrapper"
            >
              <div
                class="euiFlexGroup euiFlexGroup--gutterSmall euiFlexGroup--alignItemsCenter euiFlexGroup--directionRow"
                id="id-0.8102490791961936"
              >
                <div
                  class="euiFlexItem euiFlexItem--flexGrowZero"
                >
                  <span
                    data-euiicon-type="user"
                  />
                </div>
                <div
                  class="euiFlexItem"
                >
                  <div
                    class="euiSpacer euiSpacer--xs"
                  />
                  <div
                    class="euiText euiText--medium"
                  >
                    jdoe
                  </div>
                  <div
                    class="euiSpacer euiSpacer--xs"
                  />
                </div>
              </div>
            </div>
          </div>
          <div
            class="euiFormRow"
            id="id-0.32052263149911386-row"
          >
            <div
              class="euiFormRow__labelWrapper"
            >
              <label
                class="euiFormLabel euiFormRow__label euiFormLabel-isFocused"
                for="id-0.32052263149911386"
              >
                Current password
              </label>
            </div>
            <div
              class="euiFormRow__fieldWrapper"
            >
              <div
                class="euiFormControlLayout euiFormControlLayout--group"
              >
                <div
                  class="euiFormControlLayout__childrenWrapper"
                >
                  <input
                    autocomplete="current-password"
                    class="euiFieldPassword euiFieldPassword--inGroup euiFieldPassword--withToggle"
                    id="id-0.32052263149911386"
                    name="current_password"
                    type="password"
                    value=""
                  />
                  <div
                    class="euiFormControlLayoutIcons"
                  >
                    <span
                      class="euiFormControlLayoutCustomIcon"
                    >
                      <span
                        aria-hidden="true"
                        class="euiFormControlLayoutCustomIcon__icon"
                        data-euiicon-type="lock"
                      />
                    </span>
                  </div>
                </div>
                <button
                  aria-label="Show password as plain text. Note: this will visually expose your password on the screen."
                  class="euiButtonIcon euiButtonIcon--primary euiButtonIcon--empty euiButtonIcon--xSmall euiFormControlLayout__append"
                  title="Show password as plain text. Note: this will visually expose your password on the screen."
                  type="button"
                >
                  <span
                    aria-hidden="true"
                    class="euiButtonIcon__icon"
                    color="inherit"
                    data-euiicon-type="eye"
                  />
                </button>
              </div>
            </div>
          </div>
          <div
            class="euiFormRow"
            id="id-0.22337527773731347-row"
          >
            <div
              class="euiFormRow__labelWrapper"
            >
              <label
                class="euiFormLabel euiFormRow__label"
                for="id-0.22337527773731347"
              >
                New password
              </label>
            </div>
            <div
              class="euiFormRow__fieldWrapper"
            >
              <div
                class="euiFormControlLayout euiFormControlLayout--group"
              >
                <div
                  class="euiFormControlLayout__childrenWrapper"
                >
                  <input
                    aria-describedby="id-0.22337527773731347-help-0"
                    autocomplete="new-password"
                    class="euiFieldPassword euiFieldPassword--inGroup euiFieldPassword--withToggle"
                    id="id-0.22337527773731347"
                    name="password"
                    type="password"
                    value=""
                  />
                  <div
                    class="euiFormControlLayoutIcons"
                  >
                    <span
                      class="euiFormControlLayoutCustomIcon"
                    >
                      <span
                        aria-hidden="true"
                        class="euiFormControlLayoutCustomIcon__icon"
                        data-euiicon-type="lock"
                      />
                    </span>
                  </div>
                </div>
                <button
                  aria-label="Show password as plain text. Note: this will visually expose your password on the screen."
                  class="euiButtonIcon euiButtonIcon--primary euiButtonIcon--empty euiButtonIcon--xSmall euiFormControlLayout__append"
                  title="Show password as plain text. Note: this will visually expose your password on the screen."
                  type="button"
                >
                  <span
                    aria-hidden="true"
                    class="euiButtonIcon__icon"
                    color="inherit"
                    data-euiicon-type="eye"
                  />
                </button>
              </div>
              <div
                class="euiFormHelpText euiFormRow__text"
                id="id-0.22337527773731347-help-0"
              >
                Password must be at least 6 characters.
              </div>
            </div>
          </div>
          <div
            class="euiFormRow"
            id="id-0.6985376896076476-row"
          >
            <div
              class="euiFormRow__labelWrapper"
            >
              <label
                class="euiFormLabel euiFormRow__label"
                for="id-0.6985376896076476"
              >
                Confirm password
              </label>
            </div>
            <div
              class="euiFormRow__fieldWrapper"
            >
              <div
                class="euiFormControlLayout euiFormControlLayout--group"
              >
                <div
                  class="euiFormControlLayout__childrenWrapper"
                >
                  <input
                    autocomplete="new-password"
                    class="euiFieldPassword euiFieldPassword--inGroup euiFieldPassword--withToggle"
                    id="id-0.6985376896076476"
                    name="confirm_password"
                    type="password"
                    value=""
                  />
                  <div
                    class="euiFormControlLayoutIcons"
                  >
                    <span
                      class="euiFormControlLayoutCustomIcon"
                    >
                      <span
                        aria-hidden="true"
                        class="euiFormControlLayoutCustomIcon__icon"
                        data-euiicon-type="lock"
                      />
                    </span>
                  </div>
                </div>
                <button
                  aria-label="Show password as plain text. Note: this will visually expose your password on the screen."
                  class="euiButtonIcon euiButtonIcon--primary euiButtonIcon--empty euiButtonIcon--xSmall euiFormControlLayout__append"
                  title="Show password as plain text. Note: this will visually expose your password on the screen."
                  type="button"
                >
                  <span
                    aria-hidden="true"
                    class="euiButtonIcon__icon"
                    color="inherit"
                    data-euiicon-type="eye"
                  />
                </button>
              </div>
            </div>
          </div>
          <input
            hidden=""
            type="submit"
          />
        </form>
      </div>
    </div>
  </div>
  <div
    class="euiFlyoutFooter"
  >
    <div
      class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--justifyContentSpaceBetween euiFlexGroup--directionRow euiFlexGroup--responsive"
    >
      <div
        class="euiFlexItem euiFlexItem--flexGrowZero"
      >
        <button
          class="euiButtonEmpty euiButtonEmpty--primary euiButtonEmpty--flushRight"
          data-test-subj="formFlyoutCancelButton"
          type="button"
        >
          <span
            class="euiButtonContent euiButtonEmpty__content"
          >
            <span
              class="euiButtonEmpty__text"
            >
              Cancel
            </span>
          </span>
        </button>
      </div>
      <div
        class="euiFlexItem euiFlexItem--flexGrowZero"
      >
        <button
          class="euiButton euiButton--primary euiButton--fill"
          data-test-subj="formFlyoutSubmitButton"
          type="button"
        >
          <span
            class="euiButtonContent euiButton__content"
          >
            <span
              class="euiButton__text"
            >
              Change password
            </span>
          </span>
        </button>
      </div>
    </div>
  </div>
</div>
    at waitForWrapper (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/@testing-library/dom/dist/wait-for.js:173:27)
    at findByText (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/@testing-library/dom/dist/query-helpers.js:101:33)
    at Object.<anonymous> (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/x-pack/plugins/security/public/management/users/edit_user/edit_user_page.test.tsx:349:26)
    at _callCircusTest (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:212:5)
    at _runTest (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:149:3)
    at _runTestsForDescribeBlock (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:63:9)
    at _runTestsForDescribeBlock (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:57:9)
    at run (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:25:3)
    at runAndTransformResultsToJestFormat (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:176:21)
    at jestAdapter (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:109:19)
    at runTestInternal (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-runner/build/runTest.js:380:16)
    at runTest (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-runner/build/runTest.js:472:34)
    at Object.worker (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-runner/build/testWorker.js:133:12)

Metrics [docs]

✅ unchanged

History

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

@jen-huang jen-huang added v8.0.0 and removed 8.0.0 labels Oct 20, 2021
@kevinlog
Copy link
Contributor Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

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

@kevinlog kevinlog added the auto-backport Deprecated - use backport:version if exact versions are needed label Oct 21, 2021
@kevinlog kevinlog merged commit c53004f into elastic:master Oct 21, 2021
@kevinlog kevinlog deleted the task/update-timestamps-in-metadata-tests branch October 21, 2021 17:08
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 21, 2021
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.16

This backport PR will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Oct 21, 2021
shivindera pushed a commit to shivindera/kibana that referenced this pull request Oct 25, 2021
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:Defend Workflows “EDR Workflows” sub-team of Security Solution v7.16.0 v8.0.0
Projects
None yet
6 participants