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

[FEAT] Improve tests #296

Merged
merged 18 commits into from
Aug 6, 2023
Merged

[FEAT] Improve tests #296

merged 18 commits into from
Aug 6, 2023

Conversation

dni
Copy link
Collaborator

@dni dni commented Aug 6, 2023

everything works now for me locally.
for description look at my commit messages :)

@codecov
Copy link

codecov bot commented Aug 6, 2023

Codecov Report

Patch coverage: 64.28% and project coverage change: -0.05% ⚠️

Comparison is base (ca2b8e7) 57.04% compared to head (d4d148d) 56.99%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #296      +/-   ##
==========================================
- Coverage   57.04%   56.99%   -0.05%     
==========================================
  Files          43       43              
  Lines        3997     3995       -2     
==========================================
- Hits         2280     2277       -3     
- Misses       1717     1718       +1     
Files Changed Coverage Δ
cashu/wallet/api/router.py 68.42% <64.28%> (-0.78%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dni dni requested review from callebtc and AngusP August 6, 2023 13:34
pyproject.toml Outdated Show resolved Hide resolved
@callebtc callebtc merged commit 0a5beb7 into main Aug 6, 2023
7 checks passed
@callebtc callebtc deleted the improve-tests branch August 6, 2023 16:35
Comment on lines +22 to +33
settings.cashu_dir = "./test_data/"
settings.mint_host = "localhost"
settings.mint_port = SERVER_PORT
settings.mint_host = "0.0.0.0"
settings.mint_listen_port = SERVER_PORT
settings.mint_url = SERVER_ENDPOINT
settings.lightning = False
settings.tor = False
settings.mint_lightning_backend = "FakeWallet"
settings.mint_database = "./test_data/test_mint"
settings.mint_derivation_path = "0/0/0/0"
settings.mint_private_key = "TEST_PRIVATE_KEY"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hrm, overwriting the settings like this strikes me as a bad idea -- to me intuitively settings should be immutable, avoids having value A at some time, then a bit of code runs, then it's now value B, things break or are confusing. Or potentially if you just import this file, it'll mangle the settings because the mutation doesn't happen in a function. Also as they're currently configured, they'll be type-checked on load (and will error if a setting is wrong), but they won't be when you re-assign them like this.

Instead it'd be 'better' to use a separate .env for the tests (docs)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its a hard override on settings for conftest. i think its fine, mixing up different .env is error prone too. i could just prefix the poetry run command inside Makefile but then running it with poetry run pytest does not work.

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.

3 participants