This is an automated email from the ASF dual-hosted git repository. jackietien pushed a commit to branch iotdb in repository https://gitbox.apache.org/repos/asf/tsfile.git
commit 77db2076caa9a5bdf7c61959f66dc3a701a69979 Author: Haonan <[email protected]> AuthorDate: Fri Aug 2 00:57:04 2024 +0800 Use pytest to run python test (#194) --- .github/workflows/code-coverage.yml | 2 +- python/pom.xml | 18 +++++++++++++++++- python/test.py | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/code-coverage.yml b/.github/workflows/code-coverage.yml index f1a4f116..3240ee0d 100644 --- a/.github/workflows/code-coverage.yml +++ b/.github/workflows/code-coverage.yml @@ -27,7 +27,7 @@ jobs: - name: Generate code coverage reports run: | sudo apt-get install lcov - ./mvnw -B -P with-java,with-cpp,with-code-coverage clean verify + ./mvnw -B -P with-java,with-cpp,with-python,with-code-coverage clean verify lcov --capture --directory cpp/target/build/test --output-file cpp/target/build/test/coverage.info lcov --remove cpp/target/build/test/coverage.info '*/tsfile/cpp/test/*' --output-file cpp/target/build/test/coverage_filtered.info genhtml cpp/target/build/test/coverage_filtered.info --output-directory cpp/target/build/test/coverage_report diff --git a/python/pom.xml b/python/pom.xml index 09a61c71..7791e832 100644 --- a/python/pom.xml +++ b/python/pom.xml @@ -107,6 +107,22 @@ </arguments> </configuration> </execution> + <execution> + <id>python-install-test-requirements</id> + <phase>process-test-resources</phase> + <goals> + <goal>exec</goal> + </goals> + <configuration> + <executable>${python.venv.bin}${python.exe.bin}</executable> + <arguments> + <argument>-m</argument> + <argument>pip</argument> + <argument>install</argument> + <argument>pytest</argument> + </arguments> + </configuration> + </execution> <execution> <id>run-python-tests</id> <phase>test</phase> @@ -114,7 +130,7 @@ <goal>exec</goal> </goals> <configuration> - <executable>${python.venv.bin}${python.exe.bin}</executable> + <executable>${python.venv.bin}pytest</executable> <arguments> <argument>${project.basedir}/test.py</argument> </arguments> diff --git a/python/test.py b/python/test.py index e4838742..29fb6c24 100644 --- a/python/test.py +++ b/python/test.py @@ -29,7 +29,7 @@ import tsfile as ts from tsfile.tsfile import EmptyFileError TABLE_NAME = "test_table" -DATA_PATH = os.path.join(os.path.dirname(__file__), "data") +DATA_PATH = os.path.join(os.path.dirname(__file__), "target") # test writing data
