From e47ca24e2f1855b026b273382358b5e1f9b43aa7 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Tue, 20 Aug 2024 02:16:01 -0400 Subject: [PATCH] ci: test Python 3.12 (#4059) ## Summary by CodeRabbit - **Chores** - Updated the Python version in the CI/CD workflow from 3.11 to 3.12, enhancing compatibility and performance for testing environments. - **Bug Fixes** - Improved error reporting in parallel training tests, providing clearer output for failures to aid in debugging. --------- Signed-off-by: Jinzhe Zeng Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .github/workflows/test_python.yml | 4 ++-- source/tests/tf/test_parallel_training.py | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_python.yml b/.github/workflows/test_python.yml index 3cf56ecbd3..d4f8897d6f 100644 --- a/.github/workflows/test_python.yml +++ b/.github/workflows/test_python.yml @@ -16,7 +16,7 @@ jobs: fail-fast: false matrix: group: [1, 2, 3, 4, 5, 6] - python: ["3.8", "3.11"] + python: ["3.8", "3.12"] steps: - uses: actions/checkout@v4 @@ -68,7 +68,7 @@ jobs: strategy: fail-fast: false matrix: - python: ["3.8", "3.11"] + python: ["3.8", "3.12"] needs: testpython steps: - name: Get durations from cache diff --git a/source/tests/tf/test_parallel_training.py b/source/tests/tf/test_parallel_training.py index 13346a2c30..0d9d7c1b94 100644 --- a/source/tests/tf/test_parallel_training.py +++ b/source/tests/tf/test_parallel_training.py @@ -40,12 +40,16 @@ def test_two_workers(self): stdout=sp.PIPE, stderr=sp.STDOUT, ) + lines = [] for line in iter(popen.stdout.readline, b""): if hasattr(line, "decode"): line = line.decode("utf-8") line = line.rstrip() + lines.append(line) popen.wait() - self.assertEqual(0, popen.returncode, "Parallel training failed!") + self.assertEqual( + 0, popen.returncode, f"Parallel training failed!\n{''.join(lines)}" + ) if __name__ == "__main__":