python3-driver icon indicating copy to clipboard operation
python3-driver copied to clipboard

Initial Proof-of-Concept for #22 (use Firebird embedded for Tests)

Open fdcastel opened this issue 2 years ago • 5 comments

Initial Proof-of-Concept for #22. Do not merge. For initial review only.

  • Windows only (may be expanded to other O.S. later)
  • Helper scripts in Powershell (may be converted to Python)
  • Uses environment variables to pass parameters to test code (simpler than command line arguments)
  • Adds files for VSCode debug/test explorer support (may be removed)

Use the script Rebuild-Databases to

  • download the latest binaries to a $env:TEMP/firebird-driver-tests folder; and
  • rebuild test databases from ./test/fbtest30-src.fbk backup file.

Use the script Set-TestEnvironment to update .env file used by VSCode to discover and run tests.

fdcastel avatar May 13 '23 21:05 fdcastel

Added @pcisar suggestions from #22.

With one difference: it is still using the databases built from Powershell script (instead of the commited ones).

I believe the best course of action from here would be to incorporate the Rebuild-Databases.ps1 logic into tests Setup (in Python).

There are other databases already being created (e.g. fbevents.fdb) in some test cases. Ideally all of them should be built from a single piece of code.

I'll look into this in the next few days. I believe it will make everything simpler.

fdcastel avatar May 14 '23 17:05 fdcastel

I'll look into this in the next few days. I believe it will make everything simpler.

@pcisar if you have other considerations, please comment.

fdcastel avatar May 14 '23 17:05 fdcastel

@pcisar do you have the script to build fbtest30-src.fbk from scratch?

I tried to reverse engineer it but my tools cannot decode the ARRAY columns.

The idea is to rebuild the databases from SQL instead from gbak / .fbk.

fdcastel avatar May 14 '23 17:05 fdcastel

Offtopic. Sometimes I got these errors

./test_driver.py::TestServerStandard::test_wait Failed with Error: 'ascii' codec can't decode byte 0xe3 in position 3280: ordinal not in range(128)
./test_driver.py::TestServerStandard::test_running Failed with Error: 'ascii' codec can't decode byte 0xe3 in position 3280: ordinal not in range(128)

./test_driver.py::TestServerServices::test_01_output_by_line Failed with Error: 'ascii' codec can't decode byte 0xe3 in position 2: ordinal not in range(128)
./test_driver.py::TestServerServices::test_02_output_to_eof Failed with Error: 'ascii' codec can't decode byte 0xe3 in position 3280: ordinal not in range(128)
./test_driver.py::TestServerServices::test_03_log Failed with Error: 'ascii' codec can't decode byte 0xe3 in position 3280: ordinal not in range(128)

I have no idea where they come from. It seems something related to UTF8 (which uses 128 as special marker)?

fdcastel avatar May 14 '23 19:05 fdcastel

@pcisar Could you help me with this one?

@pcisar do you have the script to build fbtest30-src.fbk from scratch?

I tried to reverse engineer it but my tools cannot decode the ARRAY columns.

The idea is to rebuild the databases from SQL instead from gbak / .fbk.

fdcastel avatar May 28 '23 14:05 fdcastel