Code Monkey home page Code Monkey logo

Comments (6)

JoshuaKGoldberg avatar JoshuaKGoldberg commented on August 17, 2024 2

Ah sorry if the OP is unclear, thanks for asking!

Right now a lot of projects have package.json scripts that look like this (example: analyzing-dna):

"scripts": {
  "test": "jest",
  "test:solutions": "cross-env TEST_SOLUTIONS=1 jest"
}

Nothing in CI validates that the solution file (typically solutions.ts) in those projects passes TypeScript type checking. Someone could send in a PR with solution code that passes Jest tests but has a type error.

So, there should be some new step added to builds that runs tsc on all solution code. Does that make sense?

from projects.

fuadop avatar fuadop commented on August 17, 2024

Hey @JoshuaKGoldberg , I don't seem to understand this issue and I would love to help with it, if possible.

from projects.

fuadop avatar fuadop commented on August 17, 2024

This makes sense @JoshuaKGoldberg .

Should this be another CI? Or should it be augmented with the solutions CI?

from projects.

JoshuaKGoldberg avatar JoshuaKGoldberg commented on August 17, 2024

What do you see as the pros and cons of those two options? 🙂

from projects.

fuadop avatar fuadop commented on August 17, 2024

The cons of augmenting them IMO is if the solutions CI fail, and one runs the test on their local machine and it passes they might be confused. I would add descriptive logs like type errors at /path/to/file.

The pro of augmenting IMO is the speed of CI.

from projects.

JoshuaKGoldberg avatar JoshuaKGoldberg commented on August 17, 2024

if the solutions CI fail, and one runs the test on their local machine and it passes they might be confused

Sorry, I don't follow why this would be likely to happen? Assuming the user has run npm install, why would they be different locally vs. on CI?

I see the cons of augmenting as being mostly related to the cons of running the two checks in series:

  • Clarity: If the first fails, the second won't even start
  • Speed: The second can't start until the first is done.

They could be run in parallel, but the CI images are pretty limited and don't have a lot of cores. Also I'd imagine the output logs would be confusing to read.

In general for CI, I've found it to be better to have a single job/workflow per discrete action/check. In this case that would lean towards adding a new one for tsc.

from projects.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.