Giter Club home page Giter Club logo

Comments (5)

senekor avatar senekor commented on August 26, 2024 1

I've added a test case in #1879. It doesn't run in CI at all, but should come in handy to keep everything tidy manually. (It discovered three or four oversights already.)

I'd say it doesn't make sense to try to push it further before we approach the long-term goal of #1721.

from rust.

jpal91 avatar jpal91 commented on August 26, 2024

Since I know this one is my fault, I'm willing to help out! Haha.

Should be fairly straight-forward, though, from what I see. Most all of the code you would need is already in rust-tooling/generate so you could just read the file to string and see if it equals the result of generate_tests(). generate would just need to be added as a dependency to ci-tests.

Let me know!

from rust.

jpal91 avatar jpal91 commented on August 26, 2024

Actually I take that last part back now that I look at it more. No sense in compiling the entire crate just for 1-2 function(s). Copy + paste would be better but if anything changes with generate_tests() or filters get added down the line (like mentioned in CONTRIBUTING.md), that would cause an issue.

Maybe we could move those functions to rust-tooling/utils instead?

from rust.

senekor avatar senekor commented on August 26, 2024

Maybe that was the reason I didn't add a test like that in the first place when I wrote the generator. However we slice and dice the crates, test generation is always going to compile tera, which does take a while.

A few considerations that come to mind right now:

  • We could not run the test in CI on PRs to save time (only run in CI when pushing to main)
  • not run in CI at all but provide the test for local convenience.
  • just have a bit slower CI. we're only taking about 1-2 minutes difference I'd guess.

With regards to you taking over the work, I'm not sure you'd have a great experience. There's a good chance that a bunch of the test templates are actually broken right now. The problem is that I'm not completely happy with how the Rust generator interacts with tera templates and json from upstream... one part of the chain always ends up more complicated and ugly than I would like. A good solution here might involve changing how the generator works to some extent and refactoring many existing tera templates.

Apologies, I opened the issue as a sort of note to myself, it was not yet thought through 100%.

from rust.

jpal91 avatar jpal91 commented on August 26, 2024

That makes sense. It does look a little tricky from the code base.

Maybe do something half-way until you have to push to main? Like pull the function names, and check that they are all present. There will still have to be a more concrete test that compares the parsed tera later, but at least you'd avoid more overhead on most PRs.

I may look around a little bit more and see if I notice anything else, though. I agree it's definitely something that needs to be added.

from rust.

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.