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

Replacement for with_testsui #427

Merged
merged 1 commit into from
Jun 21, 2023
Merged

Replacement for with_testsui #427

merged 1 commit into from
Jun 21, 2023

Conversation

mih
Copy link
Member

@mih mih commented Jun 21, 2023

Replacement for with_testsui

This provides two fixtures

  • datalad_interactive_ui

  • datalad_noninteractive_ui

    that can be used to test user interaction or communication sequences.
    Unlike the datalad-core test UI, this is not only provisioning
    user input. In addition, it allows for inspecting a detailed UI
    call log, and offers a text-rendering to easy debugging:

(Pdb) print(ui)
InteractiveTestUI(
 question: (('attr1',), {'title': 'dummyquestion'})
 response: attr1
 question: (('attr2',), {'title': None})
 response: attr2
 question: (('secret',), {'title': None, 'repeat': True, 'hidden': True})
 response: secret
 (unused responses: [])
)

Closes #423

TODO

  • actually use it to test more
  • document

@christian-monch
Copy link
Contributor

christian-monch commented Jun 21, 2023

debian-platform based tests are failing due to release info update for an Erlang repo. PR #428 fixes this. It is just a single commit (b42ac64), did not want to mess with your branch, (and the commit in the PR might not be the preferred solution anyway), otherwise I would have cherry-picked it to this branch.

@mih mih force-pushed the bf-423 branch 2 times, most recently from 2ed4a4f to 74b3fc1 Compare June 21, 2023 13:34
This provides two fixtures

- `datalad_interactive_ui`
- `datalad_noninteractive_ui`

that can be used to test user interaction or communication sequences.
Unlike the datalad-core test UI, this is not only provisioning
user input. In addition, it allows for inspecting a detailed UI
call log, and offers a text-rendering to easy debugging:

```
(Pdb) print(iu)
InteractiveTestUI(
  question: (('attr1',), {'title': 'dummyquestion'})
  response: attr1
  question: (('attr2',), {'title': None})
  response: attr2
  question: (('secret',), {'title': None, 'repeat': True, 'hidden': True})
  response: secret
  (unused responses: [])
)
```

Closes datalad#423
@mih mih marked this pull request as ready for review June 21, 2023 13:42
@codecov
Copy link

codecov bot commented Jun 21, 2023

Codecov Report

Patch coverage: 93.00% and project coverage change: +1.28 🎉

Comparison is base (5419a3f) 90.75% compared to head (e6e6cb8) 92.04%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #427      +/-   ##
==========================================
+ Coverage   90.75%   92.04%   +1.28%     
==========================================
  Files         122      122              
  Lines        9034     9103      +69     
==========================================
+ Hits         8199     8379     +180     
+ Misses        835      724     -111     
Impacted Files Coverage Δ
datalad_next/conftest.py 100.00% <ø> (ø)
datalad_next/tests/utils.py 76.72% <82.50%> (+2.36%) ⬆️
datalad_next/commands/tests/test_credentials.py 98.50% <100.00%> (+<0.01%) ⬆️
datalad_next/commands/tests/test_download.py 100.00% <100.00%> (+37.14%) ⬆️
datalad_next/credman/tests/test_credman.py 100.00% <100.00%> (ø)
datalad_next/tests/fixtures.py 94.66% <100.00%> (+7.16%) ⬆️

... and 7 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@mih mih merged commit e22b871 into datalad:main Jun 21, 2023
@mih mih deleted the bf-423 branch June 21, 2023 14:37
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.

Implement with_testsui replacement as fixture
2 participants