-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add explanatory text on tests #124
Conversation
content/docs/guide-development.md
Outdated
@@ -258,6 +258,13 @@ os.environ['ODA_SECRET_STORAGE'] = '/secrets_custom' | |||
|
|||
It is a good practice to test the developed notebook. This allows to make sure that the code remains valid in the future. | |||
A test is implemented as another notebook, except that name of the notebook starts with "test_". The notebook should call other notebooks and check that the output matches expectations. See an example of such a test [here](https://gitlab.renkulab.io/astronomy/mmoda/mmoda-nb2workflow-example/-/blob/master/notebooks/test_lightcurve.ipynb). | |||
To run tests, it is necessary to add some dependencies to the basic environment: in `environment.yml`, add libmagic see [this example](https://gitlab.renkulab.io/astronomy/mmoda/jemx-expert/-/blob/main/environment.yml?ref_type=heads); in `requirements.txt` add the `dispatcher-plugin-nb2workflow` from the git repository, see the last line of [this example](https://gitlab.renkulab.io/astronomy/mmoda/jemx-expert/-/blob/main/requirements.txt?ref_type=heads). |
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.
Why libmagic
here? Isn't it specific to jemx-expert
?
Concerning dispatcher-plugin-nb2workflow
, it helps to look on how dispatcher "understands" the workflow and possible "catch" improper annotations. But it's not needed to run a test notebook.
The downside of having it in the requirements is that it will be installed in the container, blowing its size and complicating dependencies.
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.
Hi Denys, thanks for this comment. We had already part of this discussion, but it is important to review our understanding.
libmagic
is required by nb2workflow to run the notebook possibly through the plugin (see missing compulsory argument in nbadapter call to NB2WProductQuery from dispatcher-plugin-nb2workflow nb2workflow#199 (comment) )- without
dispatcher-plugin-nb2workflow
nb2workflow run did not complete (see missing compulsory argument in nbadapter call to NB2WProductQuery from dispatcher-plugin-nb2workflow nb2workflow#199 (comment) )
I would be happy if this could simplify, but this is what we concluded trying to run a test on my notebooks.
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.
- OK, this dependency problems need to be resolved in the package Possibly dependencies problem with
libmagic
dispatcher-plugin-nb2workflow#124
Having some dependencies pinned in the repo is sometimes necessary, but I wouldn't recommend putting this into docs. In this case, it's a kind of hotfix.
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.
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.
I now better understand this libmagic issue. libmagic
itself is not a python package. Therefore, it's not possible to ensure its presence in the container via python package dependencies, only with conda (or modifying Dockerfile and installing with system package manager). Then the advise to install it makes sense. But it must be formulated the way it's obvious that it's only needed if there is a specific problem with dispatcher plugin.
And I still think dispatcher plugin is not strictly required there
All correct about libmagic, you summarized the issue very clearly. |
I verified that it runs also without plugin, as expected, so I modified the documentation accordingly. However, I think that it is important to keep this explanation available. It allows the developer to track possible issues. As a matter of fact, we discovered bugs and features in the plugin, which is used to render. output of workflows in the dispatcher. |
Co-authored-by: Denys Savchenko <56398430+dsavchenko@users.noreply.github.com>
@volodymyrss anything to comment? I |
based on current experience, we improve docs on testing