orchestracities / ngsi-timeseries-api

QuantumLeap: a FIWARE Generic Enabler to support the usage of NGSIv2 (and NGSI-LD experimentally) data in time-series databases
https://quantumleap.rtfd.io/
MIT License
38 stars 49 forks source link

Upgrade test coverage to PostgreSQL 14+ #776

Closed suxxez closed 1 month ago

suxxez commented 2 months ago

Is your feature request related to a problem? Please describe. We would like to use the pg_read_all_data functionality and in general stay up-to-date with PostgreSQL versions. We have tried using PG16 with QuantumLeap and it worked, but an official test and support would be great.

Describe the solution you'd like Extend test coverage to PostgreSQL 14+.

Additional context I have tried to run the tests locally myself, but failed due to the same reasons as in #700. I might spend some more time digging in and then open a PR myself.

c0c0n3 commented 2 months ago

@suxxez testing w/ more recent Timescale versions in CircleCI shouldn't be too difficult:

also we should probably update our docker compose files to use more recent versions.

What could be time consuming though is debugging tests if something breaks. Unfortunately most of our tests are either end-to-end or integration tests which can make it quite difficult at times to pin down the cause of a failure. (Yes, the majority of our tests should've been unit tests, but that's a story for another day.)

re: #700, keep in mind that we've never tried running our test suite on Windows w/ WSL. I reckon you'd be better off using a MacOS or Ubuntu machine if you can.

That said, even if you don't get around to submitting a PR, it'd be already very helpful to know which versions of Postgres/Timescale/PostGIS you'll test with and what tests fails, if any. Also, if you could please open an issue for each test that fails and attach the stack trace, that'd be great!

Thanks sooo much!

suxxez commented 2 months ago

Hey, thanks for the quick reply @c0c0n3

You're right, it was really easy to set up a CircleCI pipeline. I switched out the deprecated timescaledb-postgis image for the timescaledb-ha image and the pipeline succeeded with PG14. Specifically, I used pg14.13-ts2.16.1-all.

I'll test more versions and keep you updated. :)

suxxez commented 2 months ago

Pipeline was successful with pg16.4-ts2.16.1-all and pg15.8-ts2.16.1-all as well. One reporter test failed, but after a rerun it succeeded:

>       assert r.json()[0]['temperature']['value'] == 14
E       assert 13.0 == 14

src/reporter/tests/test_op.py:306: AssertionError

Not sure what went wrong there, but doesn't look like an issue from the PostgreSQL upgrade.

suxxez commented 2 months ago

We should maybe discuss if all tests for PostgreSQL 12-16 are needed or if 12+13 can be removed.

c0c0n3 commented 1 month ago

closed by #777

c0c0n3 commented 1 month ago

@suxxez let's keep all the PG versions for now, we can drop 12 and 13 at the end of the year.