Skip to content

Update PYTBE User Guide #150

@ckunki

Description

@ckunki

PYTBE User Guide is already of great help.

The additions described in this ticket might even increase the UX, especially for new internal users.

 1. Additionally, to the installation via pip we should also offer a poetry statement, incl. the recommended group dev:

poetry add pytest-exasol-backend --group dev

 2. The introduction is not 100% correct:

  • ACTUAL

    Below is an example of a test that requires access to the database. Note, that by default this test will run twice - once for each backend.

  • PROPOSAL

    Below is an example of a test that requires access to the database. Note: If pytest option --backend all is specified, then this test will run twice - once for each backend.

 3. The first example given in the User guide is based on some assumptions, that should be made explicit:

This example requires

  • An additional (test-) dependency to pyexasol to be added to your project
  • Database schema MY_SCHEMA and table MY_TABLE to exist
  • Database table MY_TABLE to contain 5 rows

 4. Additionally, the user guide should give an example with minimal dependencies:

import pyexasol

def test_number_of_rows_in_my_table(backend_aware_database_params):
with pyexasol.connect(**backend_aware_database_params) as conn:
value = conn.execute('SELECT 1 FROM DUAL').fetchval()
assert value == 1

 5. Explain using an existing (external) database

Sub options:

  • Run a Docker Container manually
  • Use an (external) onprem database
  • Use a SaaS instance

Rationale: While the PYTBE is convenient and can be used in CI out-of-the-box, still in our daily development cycles the latency for launching a database is painful. Most developers sooner or later will prefer running a DB instance and reusing it in multiple consecutive pytest sessions.

This is also required if Docker cannot be executed on the local machine (unsupported CPU architecture, missing adminstration permissions, etc. ). In these cases the user will want to launch a SaaS database instance and to use this in their pytest sessions.

The user guide should also explain how to use such a database instance (onprem or saas) that has been launched manually.

See https://github.com/exasol/github-issue-adapter/blob/main/doc/developer_guide.md#running-tests-with-db for inspiration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationUser guides, tutorials, specifications

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions