-
Notifications
You must be signed in to change notification settings - Fork 337
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
Introducing "testing" object #1740
Introducing "testing" object #1740
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## testing_object #1740 +/- ##
=================================================
Coverage ? 58.71%
=================================================
Files ? 126
Lines ? 17208
Branches ? 3519
=================================================
Hits ? 10104
Misses ? 6394
Partials ? 710 ☔ View full report in Codecov by Sentry. |
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.
Just by looking at this PR, I'm struggling to see if it also applies to early bound functions. The description says that it's only for @late, but we have building in @early.
If the changes inject testing in @early, then the documentation should be adapted as such. If it doesn't then I think we should change the PR so that testing will also be available in @early.
Additionally, I would like to see a test or two.
Thanks!
I think early bound attributes are not relevant to I thought about adding some unit tests but I couldn't find counterparts for |
I also think that |
Oh, yeah, you are right about As for the tests, I don't think there is any for |
Sounds good, we've carved out some time to add a few unit tests. |
5fc33eb
to
6466a13
Compare
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.
Looks great! The tests are failing, but I added instructions on how to make them pass.
Also, you will need to run the ./src/build_utils/license/apply_copyright
script and fix flake8 warnings.
src/rez/tests/test_test.py
Outdated
|
||
def test_1(self): | ||
"""package.py unit tests are correctly run in a testing environment""" | ||
context = ResolvedContext(["testing_obj"]) |
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.
context = ResolvedContext(["testing_obj"]) | |
self.inject_python_repo() | |
context = ResolvedContext(["testing_obj"]) |
This will add a usable python
package and make it available to the tests (only this test). Without this, the tests won't be portable across platforms because we can't rely on python being available on the system. We need python to run the test suite, but that doesn't mean that calling python
should work because it doesn't have to be on PATH
, and by experience, it will sometimes not be on PATH.
The magic happens in
Lines 89 to 93 in 9094b08
repo = os.path.join(os.getcwd(), "__tests_pkg_repo") | |
os.makedirs(repo, exist_ok=True) | |
create_python_package(os.path.join(os.getcwd(), "__tests_pkg_repo")) | |
os.environ["__REZ_SELFTEST_PYTHON_REPO"] = repo |
9a09a46
to
b40e8ee
Compare
Signed-off-by: Fabrice Macagno <fabrice.macagno@al.com.au>
Co-authored-by: Jean-Christophe Morin <38703886+JeanChristopheMorinPerso@users.noreply.github.com> Signed-off-by: Fabrice Macagno <fabrice.macagno@al.com.au>
Signed-off-by: nathan-cheung <nathan.cheung.451@outlook.com> Signed-off-by: Fabrice Macagno <fabrice.macagno@al.com.au>
Signed-off-by: Nathan Cheung <nathan.cheung.451@outlook.com> Signed-off-by: Fabrice Macagno <fabrice.macagno@al.com.au>
Signed-off-by: Nathan Cheung <nathan.cheung.451@outlook.com> Signed-off-by: Fabrice Macagno <fabrice.macagno@al.com.au>
… and 'test' tests (#2) * add missing python package to test_context.py Signed-off-by: Nathan Cheung <nathan.cheung.451@outlook.com> * add missing python pacakge to test_test.py Signed-off-by: Nathan Cheung <nathan.cheung.451@outlook.com> --------- Signed-off-by: Nathan Cheung <nathan.cheung.451@outlook.com> Signed-off-by: Fabrice Macagno <fabrice.macagno@al.com.au>
I can't seem to see or have access to this option @JeanChristopheMorinPerso |
Ah, that only works for user-owned forks, see https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork. This PR comes from AL's fork. That's unfortunate. I'll find a way to fix the tests and will post the diff. |
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.
Alright, I had some time to look at the failures. I left some comments. Hopefully that should fix it.
Co-authored-by: Jean-Christophe Morin <38703886+JeanChristopheMorinPerso@users.noreply.github.com> Signed-off-by: Nate Cheung <nathan.cheung.451@outlook.com>
Tests are not working on macOS! I can probably merge the PR as is and I'll handle the linter stuff. |
The windows tests are now failing though. Argh. Anyway, at this point, I think I'll just merge this and will handle the rest in another PR. |
Hi @JeanChristopheMorinPerso , did you need something from us to be able to merge this? |
Hi @fabal, thanks for the reminder. The last couple of months have been very busy and intense for us. We didn't have the time to push your PR to the finish line unfortunately. I'm definitely planning on releasing your PR in the next release. |
31d469c
into
AcademySoftwareFoundation:testing_object
* Introducing 'testing' object Signed-off-by: Fabrice Macagno <fabrice.macagno@al.com.au> Signed-off-by: Nathan Cheung <nathan.cheung.451@outlook.com> Co-authored-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com> Co-authored-by: Nathan Cheung <nathan.cheung.451@outlook.com>
* Introducing 'testing' object Signed-off-by: Fabrice Macagno <fabrice.macagno@al.com.au> Signed-off-by: Nathan Cheung <nathan.cheung.451@outlook.com> Co-authored-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com> Co-authored-by: Nathan Cheung <nathan.cheung.451@outlook.com>
Introducing a
testing
object available in late bindings, similar to thebuilding
object, but indicating arez-test
context.