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

bump cypress timeout & add retries #225

Merged
merged 12 commits into from
Nov 7, 2023
Merged

bump cypress timeout & add retries #225

merged 12 commits into from
Nov 7, 2023

Conversation

tjheffner
Copy link
Contributor

@tjheffner tjheffner commented Oct 30, 2023

Description

Cypress was timing out when running in tugboat before any tests were actually tested.
The example_tests in the Setup & Test CI job were also logging errors, those have been fixed.

Run yarn test:examples
Using environment variables from: envs/.env.test
PASS example_tests/03_more_matchers/index.test.js
PASS example_tests/06_accessibility_tests/index.test.jsx
  ● Console

    console.error
      Warning: An update to Component3 inside a test was not wrapped in act(...).
      
      When testing, code that causes React state updates should be wrapped into act(...):
      
      act(() => {
        /* fire events that update state */
      });
      /* assert on the output */
      
      This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act
          at colors (/home/runner/work/next-build/next-build/example_tests/06_accessibility_tests/index.tsx:39:23)

      51 |       <label htmlFor="color">Color</label>
      52 |       <select
    > 53 |         onChange={(event) => setColor(event.target.value)}
         |                              ^
      5[4](https://github.com/department-of-veterans-affairs/next-build/actions/runs/6710119985/job/18234631842?pr=225#step:11:5) |         id="color"
      [5](https://github.com/department-of-veterans-affairs/next-build/actions/runs/6710119985/job/18234631842?pr=225#step:11:6)5 |         name="color"
      5[6](https://github.com/department-of-veterans-affairs/next-build/actions/runs/6710119985/job/18234631842?pr=225#step:11:7) |       >

      at printWarning (../node_modules/react-dom/cjs/react-dom.development.js:86:30)
      at error (../node_modules/react-dom/cjs/react-dom.development.js:60:[7](https://github.com/department-of-veterans-affairs/next-build/actions/runs/6710119985/job/18234631842?pr=225#step:11:8))
      at warnIfUpdatesNotWrappedWithActDEV (../node_modules/react-dom/cjs/react-dom.development.js:27589:9)
      at scheduleUpdateOnFiber (../node_modules/react-dom/cjs/react-dom.development.js:25508:5)
      at dispatchSetState (../node_modules/react-dom/cjs/react-dom.development.js:17527:7)
      at setColor (06_accessibility_tests/index.tsx:53:30)
      at HTMLUnknownElement.callCallback (../node_modules/react-dom/cjs/react-dom.development.js:4164:14)
      at HTMLUnknownElement.callTheUserObjectsOperation (../node_modules/jsdom/lib/jsdom/living/generated/EventListener.js:26:30)
      at innerInvokeEventListeners (../node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:350:25)
      at invokeEventListeners (../node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:286:3)
      at HTMLUnknownElementImpl._dispatch (../node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:233:9)
      at HTMLUnknownElementImpl.dispatchEvent (../node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:104:17)
      at HTMLUnknownElement.dispatchEvent (../node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js:241:34)
      at Object.invokeGuardedCallbackDev (../node_modules/react-dom/cjs/react-dom.development.js:4213:16)
      at invokeGuardedCallback (../node_modules/react-dom/cjs/react-dom.development.js:4277:31)
      at invokeGuardedCallbackAndCatchFirstError (../node_modules/react-dom/cjs/react-dom.development.js:4291:25)
      at executeDispatch (../node_modules/react-dom/cjs/react-dom.development.js:9041:3)
      at processDispatchQueueItemsInOrder (../node_modules/react-dom/cjs/react-dom.development.js:9073:7)
      at processDispatchQueue (../node_modules/react-dom/cjs/react-dom.development.js:9086:5)
      at dispatchEventsForPlugins (../node_modules/react-dom/cjs/react-dom.development.js:9097:3)
      at ../node_modules/react-dom/cjs/react-dom.development.js:9288:12
      at batchedUpdates$1 (../node_modules/react-dom/cjs/react-dom.development.js:26140:12)
      at batchedUpdates (../node_modules/react-dom/cjs/react-dom.development.js:3991:12)
      at dispatchEventForPluginEventSystem (../node_modules/react-dom/cjs/react-dom.development.js:9287:3)
      at dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay (../node_modules/react-dom/cjs/react-dom.development.js:6465:5)
      at dispatchEvent (../node_modules/react-dom/cjs/react-dom.development.js:6457:5)
      at dispatchDiscreteEvent (../node_modules/react-dom/cjs/react-dom.development.js:6430:5)
      at HTMLDivElement.callTheUserObjectsOperation (../node_modules/jsdom/lib/jsdom/living/generated/EventListener.js:26:30)
      at innerInvokeEventListeners (../node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:350:25)
      at invokeEventListeners (../node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:286:3)
      at HTMLSelectElementImpl._dispatch (../node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:233:9)
      at HTMLSelectElementImpl.dispatchEvent (../node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:104:17)
      at Proxy.dispatchEvent (../node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js:241:34)
      at ../node_modules/@testing-library/user-event/dist/cjs/event/dispatchEvent.js:47:43
      at Object.eventWrapper (../node_modules/@testing-library/dom/dist/config.js:25:23)
      at Object.wrapEvent (../node_modules/@testing-library/user-event/dist/cjs/event/wrapEvent.js:29:24)
      at Object.dispatchEvent (../node_modules/@testing-library/user-event/dist/cjs/event/dispatchEvent.js:47:22)
      at Object.dispatchUIEvent (../node_modules/@testing-library/user-event/dist/cjs/event/dispatchEvent.js:24:26)
      at selectOption (../node_modules/@testing-library/user-event/dist/cjs/utility/selectOptions.js:81:14)
      at Object.selectOptionsBase (../node_modules/@testing-library/user-event/dist/cjs/utility/selectOptions.js:117:13)
      at Object.<anonymous> (06_accessibility_tests/index.test.jsx:77:5)

...

PASS example_tests/01_hello_world/index.test.js
PASS example_tests/02_hello_world_async/index.test.js
PASS example_tests/04_hello_world_react/index.test.jsx

Test Suites: 7 passed, 7 total
Tests:       2 skipped, [22](https://github.com/department-of-veterans-affairs/next-build/actions/runs/6710119985/job/18234631842?pr=225#step:11:23) passed, [24](https://github.com/department-of-veterans-affairs/next-build/actions/runs/6710119985/job/18234631842?pr=225#step:11:25) total
Snapshots:   0 total
Time:        9.[67](https://github.com/department-of-veterans-affairs/next-build/actions/runs/6710119985/job/18234631842?pr=225#step:11:68)3 s
Ran all test suites.

Testing done

  • yarn test:examples
  • Cypress in tugboat works, though painfully slow

Screenshots

Cypress in tugboat:

================================================================================

  (Run Finished)


       Spec                                              Tests  Passing  Failing  Pending  Skipped  
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ ✔  newsStory.cy.js                          04:24        2        1        -        1        - │
  ├────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ ✔  storyListing.cy.js                       13:06        4        3        -        1        - │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
    ✔  All specs passed!                        17:30        6        4        -        2        -  

Example tests:

Run yarn test:examples
Using environment variables from: envs/.env.test
PASS example_tests/03_more_matchers/index.test.js
PASS example_tests/06_accessibility_tests/index.test.jsx
PASS example_tests/07_tests_with_mock_data/index.test.jsx
PASS example_tests/05_interactive_components/index.test.jsx
PASS example_tests/01_hello_world/index.test.js
PASS example_tests/02_hello_world_async/index.test.js
PASS example_tests/0[4](https://github.com/department-of-veterans-affairs/next-build/actions/runs/6710119985/job/18234631842?pr=225#step:11:5)_hello_world_react/index.test.jsx

Test Suites: 7 passed, 7 total
Tests:       2 skipped, 22 passed, 24 total
Snapshots:   0 total
Time:        10.[5](https://github.com/department-of-veterans-affairs/next-build/actions/runs/6710119985/job/18234631842?pr=225#step:11:6)[6](https://github.com/department-of-veterans-affairs/next-build/actions/runs/6710119985/job/18234631842?pr=225#step:11:7)2 s
Ran all test suites.

QA steps

Tasks

Preview Give feedback

@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 30, 2023 21:04 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 30, 2023 21:08 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 30, 2023 21:45 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 30, 2023 21:53 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 30, 2023 22:46 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 30, 2023 23:02 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 30, 2023 23:16 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 30, 2023 23:26 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 31, 2023 15:12 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 31, 2023 16:18 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat October 31, 2023 17:15 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 6, 2023 18:17 Destroyed
@tjheffner tjheffner merged commit 045e732 into main Nov 7, 2023
3 checks passed
@tjheffner tjheffner deleted the cypress-timeout branch November 7, 2023 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants