-
Notifications
You must be signed in to change notification settings - Fork 613
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
Enable pytest and bazel tests. #1243
Merged
seanpmorgan
merged 10 commits into
tensorflow:master
from
gabrieldemarmiesse:clean_pytest_branch
Mar 9, 2020
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
1df1bb9
Enable pytest AND bazel tests.
gabrieldemarmiesse 8f69692
Added an example of plain test function.
gabrieldemarmiesse ed19a6d
Merge branch 'master' into clean_pytest_branch
gabrieldemarmiesse 93f4e97
Merge branch 'master' into clean_pytest_branch
gabrieldemarmiesse 17db8ce
Use tf-cpu with bazel.
gabrieldemarmiesse 9d97249
Merge branch 'master' into clean_pytest_branch
gabrieldemarmiesse e866f11
Used OLDEST_PY_VERSION
gabrieldemarmiesse 5dc4504
Fix oldest py vesion.
gabrieldemarmiesse 6d4e033
Added a comment for python3
gabrieldemarmiesse 14dfe27
Add bazel clean.
gabrieldemarmiesse File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
.git | ||
.github | ||
*.Dockerfile | ||
|
||
.coverage* | ||
# C extensions | ||
*.so |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,3 +37,6 @@ wheels/ | |
/bazel-* | ||
/artifacts | ||
.bazelrc | ||
|
||
.coverage* | ||
htmlcov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
import unittest | ||
import sys | ||
|
||
import pytest | ||
import tensorflow as tf | ||
from tensorflow_addons.register import register_all, _get_all_shared_objects | ||
|
||
|
||
class AssertRNNCellTest(unittest.TestCase): | ||
def test_multiple_register(self): | ||
register_all() | ||
register_all() | ||
def test_multiple_register(): | ||
register_all() | ||
register_all() | ||
|
||
|
||
def test_get_all_shared_objects(self): | ||
all_shared_objects = _get_all_shared_objects() | ||
self.assertTrue(len(all_shared_objects) >= 4) | ||
def test_get_all_shared_objects(): | ||
all_shared_objects = _get_all_shared_objects() | ||
assert len(all_shared_objects) >= 4 | ||
|
||
for file in all_shared_objects: | ||
tf.load_op_library(file) | ||
for file in all_shared_objects: | ||
tf.load_op_library(file) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() | ||
sys.exit(pytest.main([__file__])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
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 would think this is an issue.
addons_cpu
will compile the custom-ops without any particular toolchain:https://github.com/tensorflow/addons/blob/master/tools/ci_testing/addons_cpu.sh#L60-L64
I thought the compile at the subsequent build would be skipped since they're already created, but they won't be compatible with tf from pypi. However the test-release-wheel is passing, so I wanted to verify with you that this isn't reverting to python_op fallback?
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 we add a
bazel clean --expunge
after this just for sanity.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.
Sure thing. I'll make sure the right toolchaine is used.