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

tests: make sure that unrelated snapshots are passing CI #956

Closed

Conversation

CommanderStorm
Copy link
Contributor

These changes seem nessesary from my point of view via running cargo test.
Lets see if CI agrees with me and something has changed between b65ccab and now or if my environment is faulty in this regard

@CommanderStorm CommanderStorm changed the title Made sure that unrelated snapshots are passing CI tests: make sure that unrelated snapshots are passing CI Sep 29, 2024
@CommanderStorm
Copy link
Contributor Author

CommanderStorm commented Sep 29, 2024

How is CI passing on this, but also #957 ???
Something is off here, will investigate with a fresh (+rested) mind tomorrow though

@obi1kenobi
Copy link
Owner

Is it possible you have some kind of cargo config that isn't in environment variables? Perhaps a .cargo/config.toml file somewhere?

These lines currently attempt to remove any non-reproducible configs, but perhaps they need to be adjusted to override env var values instead of merely removing them. This is because removals will make cargo fall back to other config, whereas overriding the env vars with desirable values will force cargo to explicitly apply the behavior we want instead of using default-or-otherwise-configured settings.

Could you see if changing those lines to explicitly set the env vars you've identified as necessary will fix the problem?

@CommanderStorm CommanderStorm marked this pull request as draft October 2, 2024 00:47
@CommanderStorm
Copy link
Contributor Author

can't really find why setting the environment varibles does not change the output of the snapshots.
This does quite make sense to me => is something which needs a more knowlegable engineer 🤷🏻‍♂️

@obi1kenobi
Copy link
Owner

My guess is this.

On CI, the ci.yml workflow sets some environment variables, and there are no further config settings in any .cargo/config.toml file or similar. Those env vars are removed here. As a result, the test runs without backtraces and works fine.

On your local system, you have a .cargo/config.toml file somewhere (home dir, inside the project, any of the locations cargo will accept) that sets some of these config keys. You don't set any env vars, so there's nothing to remove when the test tries to remove them as on the main branch. Your tests then run with backtraces, and fail with a snapshot failure.

Env vars take precedence over config file settings, so setting the env vars fixes the problem you're seeing. On CI, it has no effect because the set env vars are applying values that are already the defaults.

I would go through the paths mentioned here and look through any files they contain to find where the configs are set: https://doc.rust-lang.org/cargo/reference/config.html

@CommanderStorm
Copy link
Contributor Author

Sorry, that is not the case.

image

I have no clue..
(neither a config file, nor environement variables on my side.. nothing)

@obi1kenobi
Copy link
Owner

Hmm I'm not sure then. I'm not sure there's a way to ask cargo to list all the sources of configuration it's reading...

Consider posting on https://users.rust-lang.org/ to see if someone there has an idea?

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

Successfully merging this pull request may close these issues.

2 participants