grammers
grammers copied to clipboard
tests are failing due to examples env variable requirement
tests are failing due to missing environment variables in examples it might be better to have them as runtime dependencies instead of compile time.
additionally having those critical information in a compiled code might be a security problem.
If you're referring to TG_ID
and TG_HASH
, that is intentional. It's a good thing that the examples showcase it this way because, when shipping your finished application (imagine the official Telegram Desktop), these values must be present in the final binary (it's also the case for Telegram Desktop). There is no other option. The application cannot work without these values.
Because the application cannot work without these values, I think it's a good thing they're required at compile-time. If we can keep cargo run --example
failing, but cargo test
working, I would like that.
I'm going to close this issue. CI sets the variables for testing:
https://github.com/Lonami/grammers/blob/c348bb23988ad0d9f4f9ee76c91038975a94d155/.github/workflows/rust.yml#L27-L32
And as explained I'd prefer if they remain compile time variables.