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

simplify handlers test #2900

Merged
merged 1 commit into from
Aug 24, 2022
Merged

Conversation

ptitzler
Copy link
Member

@ptitzler ptitzler commented Aug 23, 2022

Simplify code maintenance by replacing a test resource with a link to the original resource, which is modified on the fly to produce the required input. This reduces the efforts required whenever a generic pipeline property needs to be added, changed, or removed. This also avoids the problem that tests might utilize a resource that is not a true copy of the original. An example of such a discrepancy (property order is inconsistent) can already be observed: https://github.com/elyra-ai/elyra/blob/main/elyra/templates/components/generic_properties_template.jinja2#L16 vs https://github.com/elyra-ai/elyra/blob/main/elyra/tests/pipeline/resources/properties.json#L9

What changes were proposed in this pull request?

  • See above.
  • I also considered not creating a symlink to the original resource (and loading the original resource instead) but decided against it. The main motivation is that the chosen approach is a bit more explicit and provides a hint that a test is using a resource that is not located in the elyra/tests directory.

How was this pull request tested?

pytest -v elyra/tests/pipeline/test_handlers.py

Developer's Certificate of Origin 1.1

   By making a contribution to this project, I certify that:

   (a) The contribution was created in whole or in part by me and I
       have the right to submit it under the Apache License 2.0; or

   (b) The contribution is based upon previous work that, to the best
       of my knowledge, is covered under an appropriate open source
       license and I have the right under that license to submit that
       work with modifications, whether created in whole or in part
       by me, under the same open source license (unless I am
       permitted to submit under a different license), as indicated
       in the file; or

   (c) The contribution was provided directly to me by some other
       person who certified (a), (b) or (c) and I have not modified
       it.

   (d) I understand and agree that this project and the contribution
       are public and that a record of the contribution (including all
       personal information I submit with it, including my sign-off) is
       maintained indefinitely and may be redistributed consistent with
       this project or the open source license(s) involved.

@ptitzler ptitzler added the component:test Test-related label Aug 23, 2022
@ptitzler ptitzler added this to the 3.12.0 milestone Aug 23, 2022
@elyra-bot
Copy link

elyra-bot bot commented Aug 23, 2022

Thanks for making a pull request to Elyra!

To try out this branch on binder, follow this link: Binder

Copy link
Member

@kiersten-stokes kiersten-stokes left a comment

Choose a reason for hiding this comment

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

I was just thinking about this again the other day! Very satisfying 😄

@akchinSTC akchinSTC merged commit 266d47c into elyra-ai:main Aug 24, 2022
@ptitzler ptitzler deleted the simplify_handler_test branch August 24, 2022 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:test Test-related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants