Skip to content

Commit

Permalink
Use pytest to run python test (#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
HTHou authored Aug 1, 2024
1 parent 5600e71 commit 2025ee2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 17 additions & 1 deletion python/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,30 @@
</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>
<goals>
<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>
Expand Down
2 changes: 1 addition & 1 deletion python/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
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
Expand Down

0 comments on commit 2025ee2

Please sign in to comment.