openverse-frontend icon indicating copy to clipboard operation
openverse-frontend copied to clipboard

Playwright logs are too verbose

Open obulat opened this issue 3 years ago • 1 comments

Description

Currently, it is very difficult to read through the CI Playwright logs because they are too verbose.

  1. There are talkback proxy logs for each tape that is found. Unfortunatly, it is not possible to only log the not-found tapes, so all of the tapes are being logged. It is much easier to run the tests with update_tapes set to true to see which tapes were added than it is to see which tapes are missing from the logs. We should set silent: true in the talkback options.
  2. There are lots of warnings about authentication requests failing. I'm not sure what the best way of silencing them is, but they take up a lot of vertical space in the CI logs.
Request exception ``` [WebServer] playwright_1 | WARN $sentry.captureException() called, but Sentry plugin is disabled. Arguments: [ playwright_1 | [AxiosError: Unable to retrieve API token. Request failed with status code 401] { playwright_1 | code: 'ERR_BAD_REQUEST', playwright_1 | config: { playwright_1 | transitional: [Object], playwright_1 | adapter: [Function: httpAdapter], playwright_1 | transformRequest: [Array], playwright_1 | transformResponse: [Array], playwright_1 | timeout: 30000, playwright_1 | xsrfCookieName: 'XSRF-TOKEN', playwright_1 | xsrfHeaderName: 'X-XSRF-TOKEN', playwright_1 | maxContentLength: -1, playwright_1 | maxBodyLength: -1, playwright_1 | env: [Object], playwright_1 | validateStatus: [Function: validateStatus], playwright_1 | headers: [Object], playwright_1 | baseURL: 'http://localhost:49153/v1/', playwright_1 | method: 'post', playwright_1 | url: 'auth_tokens/token/', playwright_1 | data: 'client_id=&client_secret=&grant_type=client_credentials' playwright_1 | }, playwright_1 | request: ClientRequest { playwright_1 | _events: [Object: null prototype], playwright_1 | _eventsCount: 7, playwright_1 | _maxListeners: undefined, playwright_1 | outputData: [], playwright_1 | outputSize: 0, playwright_1 | writable: true, playwright_1 | destroyed: false, playwright_1 | _last: true, playwright_1 | chunkedEncoding: false, playwright_1 | shouldKeepAlive: false, playwright_1 | maxRequestsOnConnectionReached: false, playwright_1 | _defaultKeepAlive: true, playwright_1 | useChunkedEncodingByDefault: true, playwright_1 | sendDate: false, playwright_1 | _removedConnection: false, playwright_1 | _removedContLen: false, playwright_1 | _removedTE: false, playwright_1 | _contentLength: null, playwright_1 | _hasBody: true, playwright_1 | _trailer: '', playwright_1 | finished: true, playwright_1 | _headerSent: true, playwright_1 | _closed: false, playwright_1 | socket: [Socket], playwright_1 | _header: 'POST /v1/auth_tokens/token/ HTTP/1.1\r\n' + playwright_1 | 'Accept: application/json, text/plain, */*\r\n' + playwright_1 | 'Content-Type: application/x-www-form-urlencoded;charset=utf-8\r\n' + playwright_1 | 'User-Agent: axios/0.27.2\r\n' + playwright_1 | 'Content-Length: 223\r\n' + playwright_1 | 'Host: localhost:49153\r\n' + playwright_1 | 'Connection: close\r\n' + playwright_1 | '\r\n', playwright_1 | _keepAliveTimeout: 0, playwright_1 | _onPendingData: [Function: nop], playwright_1 | agent: [Agent], playwright_1 | socketPath: undefined, playwright_1 | method: 'POST', playwright_1 | maxHeaderSize: undefined, playwright_1 | insecureHTTPParser: undefined, playwright_1 | path: '/v1/auth_tokens/token/', playwright_1 | _ended: true, playwright_1 | res: [IncomingMessage], playwright_1 | aborted: false, playwright_1 | timeoutCb: null, playwright_1 | upgradeOrConnect: false, playwright_1 | parser: null, playwright_1 | maxHeadersCount: null, playwright_1 | reusedSocket: false, playwright_1 | host: 'localhost', playwright_1 | protocol: 'http:', playwright_1 | _redirectable: [Writable], playwright_1 | [Symbol(kCapture)]: false, playwright_1 | [Symbol(kNeedDrain)]: false, playwright_1 | [Symbol(corked)]: 0, playwright_1 | [Symbol(kOutHeaders)]: [Object: null prototype] playwright_1 | }, playwright_1 | response: { playwright_1 | status: 401, playwright_1 | statusText: 'Unauthorized', playwright_1 | headers: [Object], playwright_1 | config: [Object], playwright_1 | request: [ClientRequest], playwright_1 | data: [Object] playwright_1 | } playwright_1 | } playwright_1 | ] ```

Reproduction

Look at the CI Playwright logs.

Screenshots

Resolution

  • [ ] 🙋 I would be interested in resolving this bug.

obulat avatar Aug 25 '22 16:08 obulat

What I resolved to do locally was to comment out the console.error of the request in api-token.server.ts file.

https://github.com/WordPress/openverse-frontend/blob/5f9cecc1530fe230e8eabbb93f4474bd0fe2920c/src/plugins/api-token.server.ts#L101

And also stop the logs from explicit calls to Sentry when is disabled, it's an annoying message too because is not actionable. I'll create a PR for this in a moment.

For the first, it would be nice if we could stop the api-token logs in dev mode with an environment variable or something like that.

krysal avatar Aug 25 '22 18:08 krysal

The logs are much more concise now, so we can close this issue.

obulat avatar Nov 23 '22 18:11 obulat