-
Notifications
You must be signed in to change notification settings - Fork 88
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
Testflows -> Pytest #454
Testflows -> Pytest #454
Conversation
#452 (comment) Thank you, please replace them all with pytest. |
# Array | ||
# Tuple | ||
# Map | ||
# LowCardinality |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that in the deleted regression.py, nullable tests are also marked as expected failure.
However, most of the data types tests that were "not supported" actually work, and implemented now.
@@ -30,9 +30,6 @@ RUN apt-get update -y \ | |||
libssl-dev \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably this Dockerfile should be removed entirely (in the follow-up).
"toDateTime64('2020-03-25 12:11:22.123456789', 9, 'Asia/Kathmandu')", SQL_TYPE_TIMESTAMP, | ||
"2020-03-25 09:26:22.123456789", SQL_TIMESTAMP_STRUCT{2020, 3, 25, 9, 26, 22, 123456789} | ||
"2020-03-25 06:26:22.123456789", SQL_TIMESTAMP_STRUCT{2020, 3, 25, 6, 26, 22, 123456789} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adjusted for the clickhouse server running in docker with default UTC timezone
@@ -1,100 +0,0 @@ | |||
name: Build and Test - Docker |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed as I am not sure what is the point of this. The tests are executed without this test runner.
@@ -16,6 +16,7 @@ | |||
is_python_3 = (sys.version_info.major == 3) | |||
is_windows = (os.name == 'nt') | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be revisited and rewritten in pytest in a follow-up, if necessary
the same with test.sh
- it executes a lot of queries, but never asserts the output.
@@ -107,7 +100,7 @@ jobs: | |||
-DTEST_DSN_LIST="ClickHouse DSN (ANSI);ClickHouse DSN (Unicode);ClickHouse DSN (ANSI, RBWNAT)" | |||
|
|||
- name: Build | |||
run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.build_type }} | |||
run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.build_type }} --parallel $(nproc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
speeds up the build by a few minutes
@@ -122,94 +115,96 @@ jobs: | |||
# However, these binaries are uploaded to be available in GH's 'Actions', just in case. | |||
- name: Upload the artifacts | |||
if: ${{ matrix.compiler == 'GCC' && matrix.odbc_provider == 'UnixODBC' && matrix.build_type == 'Release' && matrix.runtime_link == 'dynamic-runtime' && matrix.third_parties == 'bundled-third-parties' }} | |||
uses: actions/upload-artifact@v3 | |||
uses: actions/upload-artifact@v4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed outdated Node.js warning
docker pull ${CLICKHOUSE_SERVER_IMAGE} | ||
docker run -d --name clickhouse ${CLICKHOUSE_SERVER_IMAGE} | ||
docker ps -a | ||
docker stats -a --no-stream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CI uses docker-compose for that now, so it's more convenient locally as well.
run: | | ||
export ODBCSYSINI= | ||
export ODBCINSTINI="${{ github.workspace }}/run/.odbcinst.ini" | ||
export ODBCINI="${{ github.workspace }}/run/.odbc.ini" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably should have been made a bit cleaner and extracted into some "generate env variables" step, but it works. Note the empty ODBCSYSINI
(mentioned in the contribution guide now, too).
Feature(run=parameterized, flags=TE) | ||
|
||
if main(): | ||
xfails = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note the expected failures here.
It should be "mergeable," I think. Added some comments to make the review a bit easier. |
"toDateTime64('2020-03-25 12:11:22.123456789', 9, 'Asia/Kathmandu')", SQL_TYPE_TIMESTAMP, | ||
"2020-03-25 09:26:22.123456789", SQL_TIMESTAMP_STRUCT{2020, 3, 25, 9, 26, 22, 123456789} | ||
"2020-03-25 06:26:22.123456789", SQL_TIMESTAMP_STRUCT{2020, 3, 25, 6, 26, 22, 123456789} | ||
}/*, | ||
|
||
// TODO: uncomment once the target ClickHouse server is 21.4+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be uncommented now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it still does not work :)
# After the fix, Nullable test cases should be re-added | ||
# Sample error: Attempt to read after eof: while converting '' to UInt8. (ATTEMPT_TO_READ_AFTER_EOF) | ||
# | ||
# TODO: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we create a separate task to track these test improvements?
@alesapin, can you please confirm that
After that, we can merge the branch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's possible let's fix timezone issue.
TODO (follow-ups):
Tests will nullable types - see FIXME in the code,
None
binds as''
and the rendered queries have weird casts to String/LowCardinality(String).Sample error:
Sample rendered query:
instead of
which is still incorrect, though. Should be actually rendered as:
Salvage the useful tests from the root
test.py
andtest.sh
files and make them using pytest, tooCleanup the
test
dir