Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Draft PR to get feedback on first tests #292
Draft PR to get feedback on first tests #292
Changes from all commits
ee5d93e
b9baab4
2db4976
d18c91a
e40cbbb
f588fa0
215c8ea
b9f4ce1
dde5188
3188e72
f5c827b
19e390a
01ee105
4617286
e71b434
b29c67a
cf9f6a6
bb870ad
b9be51d
2be07c5
760a52c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "more powerful" TODO I would move to a ticket
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One probably needs to double check what exactly you want to do. Streamlits execution logic reruns from top to down and keeping the settings, so in some sense the options/interface is cached by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this used somewhere? also, redefined in
test_03...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could also use Path concatenation with
/
hereThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this could be brittle. Mb use os.pardir etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`TEST_INPUT_FILES_PATH = APP_FOLDER / "../../testfiles"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(nit) return value type hint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could use pathlib here:
.stem
or.name
or smth(and in the
with
statement)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adressing your first question:
There is
pytest.parametrize
, but I'm afraid this will become quite nasty once e.g. the input fields differ depending on the options..Maybe we should aim at unifying the workflows for the different softwares as much as possible to faciliate testing (and have less complex code).. e.g. by always displaying all fields, and just disabling those irrelevant for the current selection?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the number of fields displayed is always the same and it is just a matter of populating the options after the file is uploaded. I will change this the behaviour to show the whole interface (both file_loaders and all three dropdowns) at once and then just update the options when the files are loaded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this looked like this (pseudocode)
then 1 UI test with a mocked
get_values_for_populating_options
that checks that the fields are correctly populated would suffice ..get_values_for_populating_options
could then be tested outside of the streamlit testing frameworkThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressing your second question:
From a vertical slicing perspective: instead of testing page 02 super-thoroughly, alternatively you could first add test like these (page loads, basic user flow works) for the other pages ..
I think these kind of tests already add a lot of value. Mb add a TODO here to make transparent that the tests could be extented in terms of scope.