cockpit-project / cockpit

Cockpit is a web-based graphical interface for servers.
http://www.cockpit-project.org/
GNU Lesser General Public License v2.1
10.7k stars 1.08k forks source link

Make console warnings CI errors #19020

Open jelly opened 1 year ago

jelly commented 1 year ago

We check for console errors and let the tests fail if they contain things we think are issues, however React/PF also outputs useful information in console.warn so we should also lint/check for this.

https://github.com/cockpit-project/cockpit/blob/main/test/common/testlib.py#L1853

Example:

DevTools listening on ws://127.0.0.1:9332/devtools/browser/94a24744-466b-40fc-8341-e14a85b77191
[0626/093119.554716:WARNING:sandbox_linux.cc(393)] InitializeSandbox() called with multiple threads in process gpu-process.
> warning: Selectable only cards should not contain any other actions. If you wish to include additional actions, use a clickable and selectable card.
> warning: Selectable only cards should not contain any other actions. If you wish to include additional actions, use a clickable and selectable card.
> warning: Selectable only cards should not contain any other actions. If you wish to include additional actions, use a clickable and selectable card.
> warning: Selectable only cards should not contain any other actions. If you wish to include additional actions, use a clickable and selectable card.
> warning: Selectable only cards should not contain any other actions. If you wish to include additional actions, use a clickable and selectable card.
> warning: Selectable only cards should not contain any other actions. If you wish to include additional actions, use a clickable and selectable card.
> warning: Resolving coreutils failed: {"detail":"cannot update repo 'updates': Cannot prepare internal mirrorlist: Curl error (6): Couldn't resolve host name for https://mirrors.fedoraproject.org/metalink?repo=updates-released-f38&arch=x86_64 [Could not resolve host: mirrors.fedoraproject.org]; Last error: Curl error (6): Couldn't resolve host name for https://mirrors.fedoraproject.org/metalink?repo=updates-released-f38&arch=x86_64 [Could not resolve host: mirrors.fedoraproject.org]","code":64}
> warning: Selectable only cards should not contain any other actions. If you wish to include additional actions, use a clickable and selectable card.
> warning: Selectable only cards should not contain any other actions. If you wish to include additional actions, use a clickable and selectable card.
> warning: Selectable only cards should not contain any other actions. If you wish to include additional actions, use a clickable and selectable card.
> warning: Selectable only cards should not contain any other actions. If you wish to include additional actions, use a clickable and selectable card.
> warning: Selectable only cards should not contain any other actions. If you wish to include additional actions, use a clickable and selectable card.
> warning: Selectable only cards should not contain any other actions. If you wish to include additional actions, use a clickable and selectable card.
> warning: Selectable only cards should not contain any other actions. If you wish to include additional actions, use a clickable and selectable card.
> warning: Selectable only cards should not contain any other actions. If you wish to include additional actions, use a clickable and selectable card.
> warning: Selectable only cards should not contain any other actions. If you wish to include additional actions, use a clickable and selectable card.
> warning: Selectable only cards should not contain any other actions. If you wish to include additional actions, use a clickable and selectable card.
> warning: Selectable only cards should not contain any other actions. If you wish to include additional actions, use a clickable and selectable card.
> warning: loading available updates failed: {"detail":"cannot update repo 'updates': Cannot prepare internal mirrorlist: Curl error (6): Couldn't resolve host name for https://mirrors.fedoraproject.org/metalink?repo=updates-released-f38&arch=x86_64 [Could not resolve host: mirrors.fedoraproject.org]; Last error: Curl error (6): Couldn't resolve host name for https://mirrors.fedoraproject.org/metalink?repo=updates-released-f38&arch=x86_64 [Could not resolve host: mirrors.fedoraproject.org]","code":64}
> warning: Selectable only cards should not contain any other actions. If you wish to include additional actions, use a clickable and selectable card.
> warning: Selectable only cards should not contain any other actions. If you wish to include additional actions, use a clickable and selectable card.
> warning: Selectable only cards should not contain any other actions. If you wish to include additional actions, use a clickable and selectable card.
> warning: Selectable only cards should not contain any other actions. If you wish to include additional actions, use a clickable and selectable card.
Warning: ALREADY_ENABLED: 'dhcp' already in 'public'

Note this also contains non useful warnings so we probably would need a denylist of bad messages?

jelly commented 1 year ago

Or:

> warning: One of aria-label or aria-labelledby properties should be passed when using the progress component without a title.
jelly commented 1 year ago

This error is not catched?

DevTools listening on ws://127.0.0.1:9750/devtools/browser/fd6a935a-bf94-4877-94df-a23fbd614568
[0626/221145.622132:WARNING:sandbox_linux.cc(393)] InitializeSandbox() called with multiple threads in process gpu-process.
> warning: Resolving coreutils failed: {"detail":"cannot update repo 'updates': Cannot prepare internal mirrorlist: Curl error (6): Couldn't resolve host name for https://mirrors.fedoraproject.org/metalink?repo=updates-released-f37&arch=x86_64 [Could not resolve host: mirrors.fedoraproject.org]; Last error: Curl error (6): Couldn't resolve host name for https://mirrors.fedoraproject.org/metalink?repo=updates-released-f37&arch=x86_64 [Could not resolve host: mirrors.fedoraproject.org]","code":64}
> warning: loading available updates failed: {"detail":"cannot update repo 'updates': Cannot prepare internal mirrorlist: Curl error (6): Couldn't resolve host name for https://mirrors.fedoraproject.org/metalink?repo=updates-released-f37&arch=x86_64 [Could not resolve host: mirrors.fedoraproject.org]; Last error: Curl error (6): Couldn't resolve host name for https://mirrors.fedoraproject.org/metalink?repo=updates-released-f37&arch=x86_64 [Could not resolve host: mirrors.fedoraproject.org]","code":64}
> log: 
> log: 
> log: 
> log: 
> error: Text input: Text input requires either an id or aria-label to be specified
> error: Text input: Text input requires either an id or aria-label to be specified
> log: 
> log: 
> log: 
> error: Text input: Text input requires either an id or aria-label to be specified
> log: 
> warning: transport closed: disconnected
audit: type=1400 audit(2082801619.753:188): avc:  denied  { read } for  pid=769 comm="agetty" name="22_clhm_eth0.issue" dev="vda5" ino=229615 scontext=system_u:system_r:getty_t:s0-s0:c0.c1023 tcontext=system_u:object_r:NetworkManager_dispatcher_console_var_run_t:s0 tclass=file permissive=0
Wrote JS log to TestTimers-testCreate-fedora-37-127.0.0.2-2501-FAIL.js.log
Journal extracted to TestTimers-testCreate-fedora-37-127.0.0.2-2501-FAIL.log.gz
Traceback (most recent call last):
  File "/work/bots/make-checkout-workdir/test/common/testlib.py", line 1600, in tearDown
    self.check_journal_messages()
  File "/work/bots/make-checkout-workdir/test/common/testlib.py", line 1846, in check_journal_messages
    raise Error(UNEXPECTED_MESSAGE + "journal messages:\n" + first)
testlib.Error: FAIL: Test completed, but found unexpected journal messages:
audit: type=1400 audit(2082801619.753:188): avc:  denied  { read } for  pid=769 comm="agetty" name="22_clhm_eth0.issue" dev="vda5" ino=229615 scontext=system_u:system_r:getty_t:s0-s0:c0.c1023 tcontext=system_u:object_r:NetworkManager_dispatcher_console_var_run_t:s0 tclass=file permissive=0

# Result testCreate (__main__.TestTimers.testCreate) failed
jelly commented 1 year ago
# testNoConnectionSettings (__main__.TestNetworkingSettings.testNoConnectionSettings)
Error: unknown connection 'eth1'.
Error: cannot delete unknown connection(s): 'eth1'.
NAME             UUID                                  TYPE      DEVICE 
cloud-init eth0  1dd9a779-d327-56e1-8454-c65e2556c12c  ethernet  eth0   
lo               006e6516-9ac2-404d-a5d5-5cde5cdf71af  loopback  lo     

DevTools listening on ws://127.0.0.1:9907/devtools/browser/915838a5-f4f2-4853-a7c7-d97c711bea23
[0626/220908.149496:WARNING:sandbox_linux.cc(393)] InitializeSandbox() called with multiple threads in process gpu-process.
> info: %cDownload the React DevTools for a better development experience: https://reactjs.org/link/react-devtools font-weight:bold
52:54:01:00:00:03 -> eth2
> error: Warning: Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render%s SvgPlot NetworkPage NetworkPage 
    at NetworkPage (http://127.0.0.2:9191/cockpit/$25473a3af4f52ad5377c9da97a9731c891086554ba6a27c554d2a786a3776c58/network/networkmanager.js:60919:24)
    at WithDialogs (http://127.0.0.2:9191/cockpit/$25473a3af4f52ad5377c9da97a9731c891086554ba6a27c554d2a786a3776c58/network/networkmanager.js:57571:24)
    at App (http://127.0.0.2:9191/cockpit/$25473a3af4f52ad5377c9da97a9731c891086554ba6a27c554d2a786a3776c58/network/networkmanager.js:61608:23)
52:54:01:00:00:03 -> eth2
> error: Warning: `value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.%s input 
    at input
    at TextInputBase (http://127.0.0.2:9191/cockpit/$25473a3af4f52ad5377c9da97a9731c891086554ba6a27c554d2a786a3776c58/network/networkmanager.js:42691:7)
    at TextInput
    at div
    at div
    at GenerateId (http://127.0.0.2:9191/cockpit/$25473a3af4f52ad5377c9da97a9731c891086554ba6a27c554d2a786a3776c58/network/networkmanager.js:35031:7)
    at FormGroup (http://127.0.0.2:9191/cockpit/$25473a3af4f52ad5377c9da97a9731c891086554ba6a27c554d2a786a3776c58/network/networkmanager.js:46249:11)
jelly commented 1 year ago
# testEncrypted (__main__.TestStorageStratis.testEncrypted)

DevTools listening on ws://127.0.0.1:10185/devtools/browser/98ef63df-1203-4491-a9e8-bb5af9048767
[0626/220600.502468:WARNING:sandbox_linux.cc(393)] InitializeSandbox() called with multiple threads in process gpu-process.
> info: %cDownload the React DevTools for a better development experience: https://reactjs.org/link/react-devtools font-weight:bold
> error: Warning: React does not recognize the `%s` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `%s` instead. If you accidentally passed it from a parent component, remove it from the DOM element.%s isHoverable ishoverable 
    at tr
    at TrBase (http://127.0.0.2:9291/cockpit/$25473a3af4f52ad5377c9da97a9731c891086554ba6a27c554d2a786a3776c58/storage/storaged.js:112498:11)
    at Tr
    at tbody
    at TbodyBase (http://127.0.0.2:9291/cockpit/$25473a3af4f52ad5377c9da97a9731c891086554ba6a27c554d2a786a3776c58/storage/storaged.js:112545:11)
    at Tbody
    at table
    at TableBase (http://127.0.0.2:9291/cockpit/$25473a3af4f52ad5377c9da97a9731c891086554ba6a27c554d2a786a3776c58/storage/storaged.js:112415:7)
    at Table
    at ListingTable (http://127.0.0.2:9291/cockpit/$25473a3af4f52ad5377c9da97a9731c891086554ba6a27c554d2a786a3776c58/storage/storaged.js:112819:5)
    at div
    at CardBody (http://127.0.0.2:9291/cockpit/$25473a3af4f52ad5377c9da97a9731c891086554ba6a27c554d2a786a3776c58/storage/storaged.js:102650:11)
    at div
    at Card (http://127.0.0.2:9291/cockpit/$25473a3af4f52ad5377c9da97a9731c891086554ba6a27c554d2a786a3776c58/storage/storaged.js:102596:11)
    at OptionalPanel (http://127.0.0.2:9291/cockpit/$25473a3af4f52ad5377c9da97a9731c891086554ba6a27c554d2a786a3776c58/storage/storaged.js:120608:7)
    at FilesystemsPanel (http://127.0.0.2:9291/cockpit/$25473a3af4f52ad5377c9da97a9731c891086554ba6a27c554d2a786a3776c58/storage/storaged.js:120658:7)
    at div
    at Stack (http://127.0.0.2:9291/cockpit/$25473a3af4f52ad5377c9da97a9731c891086554ba6a27c554d2a786a3776c58/storage/storaged.js:100172:11)
    at div
    at FlexItem (http://127.0.0.2:9291/cockpit/$25473a3af4f52ad5377c9da97a9731c891086554ba6a27c554d2a786a3776c58/storage/storaged.js:96145:11)
    at div
    at Flex (http://127.0.0.2:9291/cockpit/$25473a3af4f52ad5377c9da97a9731c891086554ba6a27c554d2a786a3776c58/storage/storaged.js:96135:11)
    at section
    at PageSection (http://127.0.0.2:9291/cockpit/$25473a3af4f52ad5377c9da97a9731c891086554ba6a27c554d2a786a3776c58/storage/storaged.js:108826:11)
    at main
    at div
    at Page (http://127.0.0.2:9291/cockpit/$25473a3af4f52ad5377c9da97a9731c891086554ba6a27c554d2a786a3776c58/storage/storaged.js:108569:7)
    at Overview (http://127.0.0.2:9291/cockpit/$25473a3af4f52ad5377c9da97a9731c891086554ba6a27c554d2a786a3776c58/storage/storaged.js:123921:29)
    at StoragePage (http://127.0.0.2:9291/cockpit/$25473a3af4f52ad5377c9da97a9731c891086554ba6a27c554d2a786a3776c58/storage/storaged.js:123929:7)
> error: Warning: Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render%s SvgPlot StoragePage StoragePage 
    at StoragePage (http://127.0.0.2:9291/cockpit/$25473a3af4f52ad5377c9da97a9731c891086554ba6a27c554d2a786a3776c58/storage/storaged.js:123929:7)
/usr/lib64/python3.11/getpass.py:91: GetPassWarning: Can not control echo on the terminal.
  passwd = fallback_getpass(prompt, stream)
Warning: Password input may be echoed.
Enter key data followed by the return key: 
> warning: transport closed: disconnected
> info: %cDownload the React DevTools for a better development experience: https://reactjs.org/link/react-devtools font-weight:bold
> warning: Cryptsetup error: IO error occurred: Operation not permitted (os error 1)
> warning: transport closed: disconnected
> info: %cDownload the React DevTools for a better development experience: https://reactjs.org/link/react-devtools font-weight:bold
> error: Warning: Failed %s type: %s%s prop Invalid prop `title` of type `object` supplied to `Dialog`, expected `string`. 
    at Dialog (http://127.0.0.2:9291/cockpit/$25473a3af4f52ad5377c9da97a9731c891086554ba6a27c554d2a786a3776c58/storage/storaged.js:100298:16)
> error: Warning: React does not recognize the `%s` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `%s` instead. If you accidentally passed it from a parent component, remove it from the DOM element.%s isHoverable ishoverable 
    at tr