-
Notifications
You must be signed in to change notification settings - Fork 223
Add testing workflow and use pytest
#315
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
Merged
peytondmurray
merged 21 commits into
tensorflow:master
from
smokestacklightnin:ci/testing/use-pytest
Jul 5, 2025
Merged
Changes from 20 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
2f75420
Add `pytest` as an extra requirement
smokestacklightnin 386d089
Add `pytest.ini`
smokestacklightnin c9d54fc
Add first pass at a GitHub workflow that runs tests
smokestacklightnin 646ec4b
Add matrix for python versions
smokestacklightnin 230e73a
Fix typo
smokestacklightnin 13e62cb
Remove debugging trigger
smokestacklightnin 7c287e7
Don't use editable install. Instead use regular install
smokestacklightnin 7643665
Update install instructions
smokestacklightnin f305a18
Add note about running tests
smokestacklightnin ab5f4f8
Remove `if __name__ == "__main__":` from test files
smokestacklightnin 843c394
Remove unnecessary packages from testing workflow
smokestacklightnin fa0013c
Change `pip3` to `pip`
smokestacklightnin 6b0f11a
Change `python3` to `python`
smokestacklightnin a0e6463
Remove logging options in favor of defaults
smokestacklightnin f63a78f
Remove verbose flag
smokestacklightnin ffbb959
Add xfail mark to classes with failing tests
smokestacklightnin fbac9af
Remove timeout
smokestacklightnin 82466a2
Don't run xfailed tests
smokestacklightnin 8c29b52
Merge remote-tracking branch 'upstream/master' into ci/testing/use-py…
smokestacklightnin 46f0716
Add `xfail` mark to failing test
smokestacklightnin 3676584
Undo ruff formatting
smokestacklightnin 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| # Github action definitions for unit-tests with PRs. | ||
|
|
||
| name: tft-unit-tests | ||
| on: | ||
| pull_request: | ||
| branches: [ master ] | ||
| paths-ignore: | ||
| - '**.md' | ||
| - 'docs/**' | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| unit-tests: | ||
| if: github.actor != 'copybara-service[bot]' | ||
| runs-on: ubuntu-latest | ||
|
|
||
| strategy: | ||
| matrix: | ||
| python-version: ['3.9', '3.10', '3.11'] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| cache: 'pip' | ||
| cache-dependency-path: | | ||
| setup.py | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| pip install .[test] | ||
|
|
||
| - name: Run unit tests | ||
| shell: bash | ||
| run: | | ||
| pytest |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| [pytest] | ||
| addopts = --import-mode=importlib | ||
| testpaths = tensorflow_transform | ||
| python_files = *_test.py | ||
| norecursedirs = .* *.egg |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -259,5 +259,3 @@ def preprocessing_fn(inputs): | |
| ) | ||
|
|
||
|
|
||
| if __name__ == '__main__': | ||
| tft_unit.main() | ||
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -1993,5 +1993,3 @@ def preprocessing_fn(inputs): | |
| ) | ||
|
|
||
|
|
||
| if __name__ == '__main__': | ||
| tft_unit.main() | ||
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -760,5 +760,3 @@ def _side_effect_fn(saved_model_future, cache_value_nodes, | |
| ) | ||
|
|
||
|
|
||
| if __name__ == '__main__': | ||
| test_case.main() | ||
This file contains hidden or 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.
Uh oh!
There was an error while loading. Please reload this page.