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

Solve issues for Node.js CITGM #5489

Closed
3 tasks done
UlisesGascon opened this issue Feb 17, 2024 · 11 comments · Fixed by nodejs/citgm#977
Closed
3 tasks done

Solve issues for Node.js CITGM #5489

UlisesGascon opened this issue Feb 17, 2024 · 11 comments · Fixed by nodejs/citgm#977
Assignees

Comments

@UlisesGascon
Copy link
Member

UlisesGascon commented Feb 17, 2024

Hi team! I was researching a bit about the current issues with CITGM, there is a PR nodejs/citgm#977 open to re-add express, but one of the tests is failling.

How to reproduce?

  1. Use Node 20.x (recommended 20.11.x) nvm use 20.11.0
  2. Install cigtm globally npm i -g citgm
  3. Run the tests for express citgm express

What is the error?

info: starting            | express             
info: lookup              | express             
info: lookup-notfound     | express             
info: lookup-githead      | https://github.com/expressjs/express/archive/8368dc178af16b91b576c4c1d135f701a0007e5d.tar.gz
info: express npm:        | Downloading project: https://github.com/expressjs/express/archive/8368dc178af16b91b576c4c1d135f701a0007
info: express npm:        | Project downloaded 8368dc178af16b91b576c4c1d135f701a0007e5d.tar.gz
info: express npm:        | npm install started 
info: express npm:        | npm install successfully completed
info: express npm:        | test suite started  
error: failure             | The canary is dead: 
error: failing module(s)   |                     
error: module name:        | express             
error: version:            | 4.18.2              
error: error:              | The canary is dead: 
error: error:              | undefined                                                                                     
error:                     | added 432 packages in 36s                                                                     
error:                     |                                                                                               
error:                     | > express@4.18.2 test                                                                         
error:                     | > mocha --require test/support/env --reporter spec --bail --check-leaks test/ test/acceptance/
error:                     |                                                                                               
error:                     |          
[...redacted...]
error:                     | 350 passing (636ms)                                                                                                                                                
error:                     | 1 failing                                                                                                                                                          
error:                     |                                                                                                                                                                    
error:                     | 1) express.json()                                                                                                                                                  
error:                     | with strict option                                                                                                                                                 
error:                     | when undefined                                                                                                                                                     
error:                     | should 400 on primitives:                                                                                                                                          
error:                     | Error: expected `[entity.parse.failed] Unexpected token 't', "#rue" is not valid JSON` response body, got `[entity.parse.failed] Unexpected token 't', "#" is not v
error:                     | at Context.<anonymous> (test/express.json.js:265:12)                                                                                                               
error:                     | at process.processImmediate (node:internal/timers:478:21)                                                                                                          
error:                     | ----                                                                                                                                                               
error:                     | at error (node_modules/supertest/lib/test.js:335:15)                                                                                                               
error:                     | at Test._assertBody (node_modules/supertest/lib/test.js:206:16)                                                                                                    
error:                     | at /private/var/folders/7h/550p8fxd2gn4vwn6x_q9stdh0000gn/T/421860ca-ea70-4620-92e0-1d11e288e294/express/node_modules/supertest/lib/test.js:308:13                 
error:                     | at Test._assertFunction (node_modules/supertest/lib/test.js:285:13)                                                                                                
error:                     | at Test.assert (node_modules/supertest/lib/test.js:164:23)                                                                                                         
error:                     | at Server.localAssert (node_modules/supertest/lib/test.js:120:14)                                                                                                  
error:                     | at Object.onceWrapper (node:events:632:28)                                                                                                                         
error:                     | at Server.emit (node:events:518:28)                                                                                                                                
error:                     | at emitCloseNT (node:net:2279:8)                                                                                                                                   
error:                     | at process.processTicksAndRejections (node:internal/process/task_queues:81:21)                                                                                     
error:                     |                                                                                                                                                                    
error:                     |                                                                                                                                                                    
error:                     |                                                                                                                                                                    
error:                     |                                                                                                                                                                    
error:                     | npm notice                                                                                                                                                         
error:                     | npm notice New minor version of npm available! 10.2.4 -> 10.4.0                                                                                                    
error:                     | npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.4.0>                                                                                            
error:                     | npm notice Run `npm install -g npm@10.4.0` to update!                                                                                                              
error:                     | npm notice                                                                                                                                                         
error: done                | The smoke test has failed.
info: duration            | test duration: 49198ms

I was not able to reproduce this error while running the tests locally from a express clone, but after doing a bit of research seems like it is related to expressjs/body-parser@368a93a ?

As a side note, I will update the CI to include the most recent Node.js versions:

@dougwilson
Copy link
Contributor

Yes, I fixed that a long time ago, also in this repo too, which is probably why you cannot reproduce it while running tests locally from clone?

@UlisesGascon
Copy link
Member Author

Great point @dougwilson. Now I am thinking that maybe is because CITGM is using 4.18.2 and the patch in body-parser@1.20.2 is not yet released within express? 🤔

unreleased
==========

  * Fix routing requests without method
  * deps: body-parser@1.20.2
    - Fix strict json error message on Node.js 19+
    - deps: content-type@~1.0.5
    - deps: raw-body@2.5.2

4.18.2 / 2022-10-08
===================

  * Fix regression routing a large stack in a single route
  * deps: body-parser@1.20.1
    - deps: qs@6.11.0
    - perf: remove unnecessary object clone
  * deps: qs@6.11.0

@dougwilson
Copy link
Contributor

Oh, interesting. I guess that is true, if citgm uses published vereion it wouldn't be there. I was confused bc I saw the log saying downloading from github.com. I guess we can queue up a parch release quickly to make it available to citgm, without going through the minor release timeline.

@UlisesGascon
Copy link
Member Author

Yeah, a patch release sounds great 👍

@wesleytodd

This comment was marked as off-topic.

@dougwilson

This comment was marked as off-topic.

@wesleytodd

This comment was marked as off-topic.

@dougwilson

This comment was marked as off-topic.

@wesleytodd

This comment was marked as off-topic.

@UlisesGascon
Copy link
Member Author

Curent status

We are just waiting for this PR to be merged, the CI is passing 🥳

@UlisesGascon
Copy link
Member Author

This is officially completed! Express.js is back to the CITGM! 🎉

Gif from 'The Office' series where the employees are celebrating a party and attempting to dance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants