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 generate log option warnings #586

Closed
craigds opened this issue Mar 17, 2022 · 0 comments · Fixed by #588
Closed

Tests generate log option warnings #586

craigds opened this issue Mar 17, 2022 · 0 comments · Fixed by #588
Labels
good first issue Good for newcomers

Comments

@craigds
Copy link
Member

craigds commented Mar 17, 2022

Background

Running the tests with warnings enabled (pytest -ra) displays the following near the end of the test run:

==================================================== warnings summary =====================================================
tests/test_checkout.py::test_reset
tests/test_checkout.py::test_reset
  /Users/cdestigter/checkout/kart/kart/log.py:80: RemovalInKart012Warning: '--oneline' is unknown to Kart and will be passed directly to git. This will be removed in Kart 0.12! Please comment on https://github.com/koordinates/kart/issues/508 if you need to use this option.
    RemovalInKart012Warning,

tests/test_checkout.py::test_reset
tests/test_checkout.py::test_reset
  /Users/cdestigter/checkout/kart/kart/log.py:80: RemovalInKart012Warning: '--decorate=short' is unknown to Kart and will be passed directly to git. This will be removed in Kart 0.12! Please comment on https://github.com/koordinates/kart/issues/508 if you need to use this option.
    RemovalInKart012Warning,

tests/test_init.py::test_init_import_custom_message
  /Users/cdestigter/checkout/kart/kart/log.py:80: RemovalInKart012Warning: '-1' is unknown to Kart and will be passed directly to git. This will be removed in Kart 0.12! Please comment on https://github.com/koordinates/kart/issues/508 if you need to use this option.
    RemovalInKart012Warning,

tests/test_log.py::test_log_arg_handling[text]
  /Users/cdestigter/checkout/kart/kart/log.py:80: RemovalInKart012Warning: '-p' is unknown to Kart and will be passed directly to git. This will be removed in Kart 0.12! Please comment on https://github.com/koordinates/kart/issues/508 if you need to use this option.
    RemovalInKart012Warning,

As per #508 ,kart log currently passes unknown options on to a git log subprocess. In 0.12 we want to change that, and instead explicitly define all the options we need (here are some git log options we've already explicitly supported)

However, some existing tests are running kart log with various options that are not explicitly defined, so they are causing these warnings in the tests.

Fix plan

To solve this, we should:

  • Switch from --oneline to the explicitly-supported -o text:oneline
  • Add explicit support for --no-decorate, --decorate[=short|full|auto|no], again only when using text output
  • Switch from -1 to -n 1
  • Avoid using -p, find another way to do whatever that test is trying to do.
@craigds craigds added the good first issue Good for newcomers label Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant