This is an automated email from the ASF dual-hosted git repository. haonan pushed a commit to branch code_coverage_v3 in repository https://gitbox.apache.org/repos/asf/tsfile.git
commit d3b6f9ac00431aa2eac553d01faa47ecbc7e491e Author: HTHou <[email protected]> AuthorDate: Fri Aug 2 00:24:13 2024 +0800 try 1 try --- .github/workflows/code-coverage.yml | 3 ++- .github/workflows/unit-test.yml | 3 ++- code-coverage/copy-code-coverage-sources.sh | 20 ++++++++++---------- python/pom.xml | 18 +++++++++++++++++- python/test.py | 8 ++++---- 5 files changed, 35 insertions(+), 17 deletions(-) diff --git a/.github/workflows/code-coverage.yml b/.github/workflows/code-coverage.yml index 3240ee0d..ec4813cd 100644 --- a/.github/workflows/code-coverage.yml +++ b/.github/workflows/code-coverage.yml @@ -3,6 +3,7 @@ on: push: branches: - develop + - code_coverage_v3 paths-ignore: - 'docs/**' pull_request: @@ -27,7 +28,7 @@ jobs: - name: Generate code coverage reports run: | sudo apt-get install lcov - ./mvnw -B -P with-java,with-cpp,with-python,with-code-coverage clean verify + ./mvnw -B -P 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/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 93e95a80..ea7e0cd3 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -8,6 +8,7 @@ on: branches: - develop - iotdb + - code_coverage_v3 paths-ignore: - 'docs/**' pull_request: @@ -81,4 +82,4 @@ jobs: - name: Build and test with Maven shell: bash run: | - ./mvnw${{ steps.platform_suffix.outputs.platform_suffix }} -P with-java,with-cpp,with-python clean verify + ./mvnw${{ steps.platform_suffix.outputs.platform_suffix }} -P with-cpp,with-python clean verify diff --git a/code-coverage/copy-code-coverage-sources.sh b/code-coverage/copy-code-coverage-sources.sh index 19c24fd1..7c6361fe 100755 --- a/code-coverage/copy-code-coverage-sources.sh +++ b/code-coverage/copy-code-coverage-sources.sh @@ -18,14 +18,14 @@ # under the License. # -for file in ../java/*/target/*.exec -do - cp $file ./target/ -done - -for file in ../java/*/target/classes -do - echo "copy from" ${file} - cp -r $file ./target/ -done +#for file in ../java/*/target/*.exec +#do +# cp $file ./target/ +#done +# +#for file in ../java/*/target/classes +#do +# echo "copy from" ${file} +# cp -r $file ./target/ +#done diff --git a/python/pom.xml b/python/pom.xml index 63a3689f..0efca65c 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..a2d41bd2 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 @@ -73,9 +73,9 @@ def test_write_tsfile(): # test reading data def test_read_tsfile(): - # skip test on windows because of the bug in the tsfile library - if platform.system() == "Windows": - return + # # skip test on windows because of the bug in the tsfile library + # if platform.system() == "Windows": + # return # test read a non-existent file with ut.TestCase().assertRaises(FileNotFoundError): ts.read_tsfile(DATA_PATH + "/notexist.tsfile", TABLE_NAME, ["level", "num"])
