preslavmihaylov / todocheck

A static code analyser for annotated TODO comments
MIT License
426 stars 42 forks source link

Env var overrides cached token #182

Closed aaronangxz closed 2 years ago

aaronangxz commented 2 years ago

Fixes #175

aaronangxz commented 2 years ago

@preslavmihaylov I'm trying to run unit test TestAuthTokensCache however i'm getting

program exited with an unexpected exit code: fork/exec ../todocheck: no such file or directory and debugging shows "couldn't teardown test environment: failed to delete tokens cache ./...

Do you mind explaining what is wrong here? Do I need to do anything to set up test env? thanks!

preslavmihaylov commented 2 years ago

You need to first build the todocheck binary to run the tests.

If you run make test instead of manual go test ... it should work.

Anyways, it seems your tests pass because I ran them myself & they also pass on CI.

Do you mind creating another test which verifies that the token from env overrides the auth tokens cache? You might have to extend the testing framework a bit to support that assertion.

aaronangxz commented 2 years ago

@preslavmihaylov Great, I managed to run the tests now! However, I might be overlooking some stuff here, you can let me know if the unit test is not sufficient

preslavmihaylov commented 2 years ago

Since it's WIP, I won't merge it yet. Let me know if you're finished

aaronangxz commented 2 years ago

Marked as ready, thanks! @preslavmihaylov