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

Verify pixi schema against CLI #2057

Open
bollwyvl opened this issue Sep 16, 2024 · 2 comments
Open

Verify pixi schema against CLI #2057

bollwyvl opened this issue Sep 16, 2024 · 2 comments
Labels
✨ enhancement Feature request 🧪 test Related to tests and ideas for tests

Comments

@bollwyvl
Copy link
Contributor

Problem description

references

elevator pitch

Check for rust- (and cargo-) sensitive changes vs hard-coded values in the generated schema.

motivation

New platforms have appeared that the schema didn't know about.

Changes like this are pretty much guaranteed to happen again, and other classes of issues can be caught per-keystroke.

design ideas

During pixi r test-schema, for each schema/test/invalid/{name}.toml, e.g. bad_feature_platform.toml:

  • look for files called {name}.{action}.stderr.txt
  • if any exist, in a temporary folder
    • copy to the manifest to pixi.toml
    • run $PIXI_BIN {action}
    • compare the output to the expected

alternatives

@bollwyvl bollwyvl added the ✨ enhancement Feature request label Sep 16, 2024
@ruben-arts
Copy link
Contributor

I 100% agree with this.
Most of these hard coded things are not moved to often so we could just make simple code parser and verify that it's the same in python and in Rust. Otherwise making Python bindings for these parts and using the bindings in the model.py could also be helpful.

@ruben-arts ruben-arts added the 🧪 test Related to tests and ideas for tests label Sep 17, 2024
@bollwyvl
Copy link
Contributor Author

Welp, could PR something that was like:

flowchart LR
  build([pixi r build]) --> pixi.exe -- $PIXI_TEST_BIN --> test-schema([pixi r test-schema])
  schema([pixi r generate-schema]) --> schema.json --> test-schema
Loading

This would be outside of my wheelhouse, but probably more efficient:

flowchart LR
  test-schema([pixi r test-schema])
  schema.json --> test([pixi r test])
  schema([pixi r generate-schema]) --> schema.json --> test-schema
Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement Feature request 🧪 test Related to tests and ideas for tests
Projects
None yet
Development

No branches or pull requests

2 participants