Skip to content

Develop is green again, for the third time - #836

Merged
sridharkalaibala merged 1 commit into
developfrom
fix/develop-green-again-2
Sep 16, 2026
Merged

sridharkalaibala merged 1 commit into
developfrom
fix/develop-green-again-2

Conversation

@sridharkalaibala

Copy link
Copy Markdown
Contributor

Four failures on develop, none of them from a feature, all of them the same shape: something generated or counted, and a change that did not regenerate it. #835 cannot go green until these do.

tests/unit/routes/items.routes.test.js mocks the validation middleware and does not list validateSoldOut, so the route receives undefined where a handler belongs:

TypeError: argument handler must be a function
> 95 | router.post('/soldOut', validateSoldOut, bindController(...))

That throws at require time, so the whole suite fails before a single test runs - 2 suites, 0 tests. The route itself is fine and is serving in production; I checked the deployed shard has it and is answering.

tests/unit/middleware/items.validation.test.js fakes the express-validator chain link by link, and the sold-out validator uses .isBoolean(), which the fake did not have. Same failure mode: not at an assertion, at require. The fake now carries every link the real chain offers, so the next validator does not repeat this.

languages/server/_english.json was out of date. The tool that writes it is named in the failure message.

The README's REST badge said 658; there are 659 routes.

No behaviour. Whitespace, a generated file, a number, two test fakes.

Verified: desktop 2806 pass, api 11,097 pass.

Worth saying out loud, because this is the third one of these: all four are the cost of the same missing habit. When a change adds a route, a message or a validator, something generated has to be regenerated, and nothing tells you until CI does. A pre-push hook that regenerates and diffs would end this category.

Four failures on develop, none of them from a feature, all of them the
same shape: a thing that is generated or counted, and a change that did
not regenerate it.

tests/unit/routes/items.routes.test.js mocked the validation middleware
and did not list validateSoldOut, so the route got `undefined` where a
handler belongs. router.post throws "argument handler must be a function"
at REQUIRE time, which fails the whole suite before a single test runs -
2 suites, 0 tests. The route itself is fine and is serving in production.

tests/unit/middleware/items.validation.test.js fakes the express-validator
chain link by link, and the sold-out validator uses isBoolean, which the
fake did not have. Same failure mode: not at the assertion, at require.
The fake now carries every link the real chain offers, so the next
validator does not do this again.

languages/server/_english.json was out of date; the tool that writes it
says so by name in the failure message.

The README's REST badge said 658 and there are 659 routes.

Whitespace, a generated file, a number and two test fakes. No behaviour.

All four are the cost of the same missing habit: when a change adds a
route, a message or a validator, something generated has to be
regenerated, and nothing says so until CI does.
@sridharkalaibala
sridharkalaibala merged commit fac3b5d into develop Sep 16, 2026
10 checks passed
@github-actions github-actions Bot added the ready for QA Merged to develop and live on develop.posnic.io - anyone can test it label Sep 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Merged to develop. Anyone can test this - you do not need write access.

Try it at https://develop.posnic.io, or run it yourself:

git fetch origin develop && git checkout develop
npm install && npm --prefix api install
npm run dev   # then http://localhost:3000

When you have tested it, say what you did and what happened, and set
QA passed or QA failed. If you cannot set labels, just comment -
a maintainer will.

Reporting that something is broken is as useful as fixing it. It is
better found here than by a shopkeeper.

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

Labels

ready for QA Merged to develop and live on develop.posnic.io - anyone can test it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant