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

Attempting to debug the MSW uncaught http request error in CircleCi builds #1693

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
d596d3e
add console debug msg for hylo-node call in tests
KevinTriplett Aug 19, 2024
4034f6a
move msw debug code to mockGraphqlServer
KevinTriplett Aug 19, 2024
57f39be
add console log messages to debugging
KevinTriplett Aug 19, 2024
49d0a7f
see what "bypass unhandledRequests" option does
KevinTriplett Aug 21, 2024
61de10d
return unhandledRequest option to "error"
KevinTriplett Aug 21, 2024
1055b2e
try file structure specified by MSW doc
KevinTriplett Aug 21, 2024
5f0c1a7
correct url for msw mock handlers
KevinTriplett Aug 21, 2024
c4f18b6
add msw http handler
KevinTriplett Aug 21, 2024
8fe26f3
add handlers for socket.io/ trailing /
KevinTriplett Aug 21, 2024
62edd37
move handlers to test dir and load them
KevinTriplett Aug 21, 2024
1a870cd
remove call to console.trace in msw handler
KevinTriplett Aug 21, 2024
404efbb
delete duplicate handler
KevinTriplett Aug 22, 2024
f1731c6
try configuration changes for msw warning
KevinTriplett Aug 23, 2024
4d1f35f
uncomment debug flags for ci builds
KevinTriplett Aug 24, 2024
a1d84c9
comment circleci debug lines back out
KevinTriplett Aug 24, 2024
5a5981b
uncomment graphql queries to silence msw warning
KevinTriplett Aug 25, 2024
0df2ae7
turn off jest verbose mode
KevinTriplett Aug 25, 2024
5428502
limit ci testing to one troublesome file
KevinTriplett Aug 25, 2024
c411164
switch to AuthLayoutRouter.test.js
KevinTriplett Aug 25, 2024
481551a
change NonAuthLayoutRouter.test.js name
KevinTriplett Aug 25, 2024
7cd8ff1
add graphql query mock GroupWelcomeQuery
KevinTriplett Aug 25, 2024
cce219c
comment out 404 test
KevinTriplett Aug 25, 2024
c74ab15
comment out first test
KevinTriplett Aug 25, 2024
90bc533
remove sockets
KevinTriplett Aug 25, 2024
1d8cb7b
remove all routes
KevinTriplett Aug 25, 2024
4d89f3f
comment out as many dispatch as possible
KevinTriplett Aug 25, 2024
f34c9f2
remove mixpanel
KevinTriplett Aug 25, 2024
1e0f2b0
remove some things
KevinTriplett Aug 25, 2024
68dff6c
remove intercomprovider
KevinTriplett Aug 25, 2024
007f59e
remove routing divs
KevinTriplett Aug 25, 2024
f2de5c8
cut out everything except resizeRef div
KevinTriplett Aug 25, 2024
6a47a13
remove isWebView
KevinTriplett Aug 25, 2024
7c7f7d8
remove final fetch query
KevinTriplett Aug 25, 2024
f7fbee3
restore final fetch query to double-check
KevinTriplett Aug 26, 2024
5f6500e
integrate fetchForCurrentUser and MeQuery
KevinTriplett Aug 26, 2024
ae64a34
integrate MeCompleteFragment into Me
KevinTriplett Aug 26, 2024
8135b88
add variables to query
KevinTriplett Aug 26, 2024
035be12
comment out MeQuery in mockGraphqlServer
KevinTriplett Aug 26, 2024
43453d6
switch dispatch to check for common bug
KevinTriplett Aug 26, 2024
2ac4cb0
add dispatch to useEffect dependancy array
KevinTriplett Aug 26, 2024
f55e382
try another dispatch to get info
KevinTriplett Aug 26, 2024
443407e
try upgrading msw to v1.3.3
KevinTriplett Aug 26, 2024
827f758
try upgrading msw to v0.38.0
KevinTriplett Aug 26, 2024
200cf09
Merge branch 'evo-1684-fix-MSW-warning-received-under-CircleCI-test' …
KevinTriplett Aug 26, 2024
dc41a97
upgrade to msw 0.39.0
KevinTriplett Aug 26, 2024
89531d8
upgrade msw to 0.40.0
KevinTriplett Aug 26, 2024
c439431
upgrade msw to 0.42.0
KevinTriplett Aug 26, 2024
9193a21
upgrade msw to 1.0.0
KevinTriplett Aug 26, 2024
8d2a622
restore AuthLayoutRouter and test
KevinTriplett Aug 26, 2024
8e3d243
restore MeQuery
KevinTriplett Aug 26, 2024
e1a2234
upgrade to [email protected]
KevinTriplett Aug 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
paths:
- node_modules
# Test
- run: yarn test -- --coverage --runInBand
- run: yarn test AuthLayoutRouter.test.js #--coverage --runInBand
- run: codecov --token=c2dc871a-a23b-4a38-b105-f46e97f383c7
# Deployment in CircleCI 2.0 are better handled through workflows.
# See the documentation for more information https://circleci.com/docs/2.0/workflows/
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
"mock-fs": "^4.2.0",
"moment-locales-webpack-plugin": "^1.2.0",
"moment-timezone": "^0.5.37",
"msw": "^0.36.8",
"msw": "1.3.2",
"newrelic": "^7.0.2",
"normalize.css": "^7.0.0",
"object-assign": "4.1.1",
Expand Down
1 change: 1 addition & 0 deletions scripts/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ if (!process.env.CI && argv.indexOf('--coverage') < 0) {
// argv.push('--no-cache')

argv.push('--runInBand') // Needed to speed up test run times in docker and CI envs
argv.push('--ci') // Attempting to address warnings from msw on circleci

jest.run(argv)
12 changes: 12 additions & 0 deletions src/util/testing/handlers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { rest } from 'msw'

export const handlers = [
rest.get('/socket.io', (req, res, ctx) => {
console.log('http://localhost/socket.io called in mocked test')
// console.trace()
return res(
ctx.status(404),
ctx.json({})
)
})
]
91 changes: 47 additions & 44 deletions src/util/testing/mockGraphqlServer.js
Original file line number Diff line number Diff line change
@@ -1,51 +1,54 @@
import { setupServer } from 'msw/node'
import { handlers } from './handlers'
// import { graphql } from 'msw'

export const mockGraphqlServer = setupServer()
export const mockGraphqlServer = setupServer(...handlers)

export default mockGraphqlServer

// AuthLayoutRouter empty handlers for reference; to reduce boilerplace
// possibly pre-polulate these on each test load
//
// graphql.query('MeQuery', (req, res, ctx) => {
// return res(
// ctx.data({
// me: null
// })
// )
// }),
// graphql.query('FetchForGroup', (req, res, ctx) => {
// return res(
// ctx.data({
// group: null
// })
// )
// }),
// graphql.query('GroupDetailsQuery', (req, res, ctx) => {
// return res(
// ctx.data({
// group: null
// })
// )
// }),
// graphql.query('MessageThreadsQuery', (req, res, ctx) => {
// return res(
// ctx.data({
// me: null
// })
// )
// }),
// graphql.query('MyPendingJoinRequestsQuery', (req, res, ctx) => {
// return res(
// ctx.data({
// joinRequests: null
// })
// )
// }),
// graphql.query('NotificationsQuery', (req, res, ctx) => {
// return res(
// ctx.data({
// notifications: nulle
// })
// )
// })
// mockGraphqlServer.resetHandlers(
// graphql.query('MeQuery', (req, res, ctx) => {
// return res(
// ctx.data({
// me: null
// })
// )
// }),
// graphql.query('FetchForGroup', (req, res, ctx) => {
// return res(
// ctx.data({
// group: null
// })
// )
// }),
// graphql.query('GroupDetailsQuery', (req, res, ctx) => {
// return res(
// ctx.data({
// group: null
// })
// )
// }),
// graphql.query('MessageThreadsQuery', (req, res, ctx) => {
// return res(
// ctx.data({
// me: null
// })
// )
// }),
// graphql.query('MyPendingJoinRequestsQuery', (req, res, ctx) => {
// return res(
// ctx.data({
// joinRequests: null
// })
// )
// }),
// graphql.query('NotificationsQuery', (req, res, ctx) => {
// return res(
// ctx.data({
// notifications: null
// })
// )
// })
// )
Loading