Skip to content

Commit 70e75e4

Browse files
committed
Switch from setuptools to hatch, version 0.19.0
1 parent 310b2c2 commit 70e75e4

File tree

13 files changed

+825
-347
lines changed

13 files changed

+825
-347
lines changed

CHANGELOG.md

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
# Change Log
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](http://keepachangelog.com/)
5+
and this project adheres to [Semantic Versioning](http://semver.org/).
6+
7+
## [0.19.0] - 2024-02-08
8+
9+
### Changed
10+
11+
- Switch from `setuptools` to `hatch`.
12+
- Updated dependencies.
13+
14+
## [0.18.0] - 2023-02-14
15+
16+
### Added
17+
18+
- Added cache for empty databases. This works transparently and does not require any
19+
special configuration. Databases are stored in `dbcache` subdirectory (created automatically)
20+
for combination of ODS + page size + SQL dialect + character set.
21+
22+
Files in `dbcache` directory could be removed as needed (including whole directory)
23+
to fore creation of new database.
24+
25+
Cache is enabled by default. Use new --disable-db-cache option to disable it.
26+
27+
## [0.17.3] - 2023-02-14
28+
29+
### Added
30+
31+
- Added `--driver-config` option to specify different filename for driver configuration.
32+
33+
## [0.17.2] - 2023-01-17
34+
35+
### Fixed
36+
37+
- Trace session support in plugin now uses service query with timeout (provided by
38+
`firebird-driver 1.8.0`) and terminates the trace thread gracefuly even if terminating
39+
trace session fails.
40+
41+
## [0.17.1] - 2022-11-21
42+
43+
### Added
44+
45+
- When database initialization script fails, the XML output is extended with `dbinit-stderr`
46+
property that contains `stderr` output with errors reported by ISQL.
47+
48+
### Fixed
49+
50+
- Uregistered bug in trace.TraceConfig - redundant `flags` definition.
51+
52+
## [0.17.0] - 2022-06-30
53+
54+
### Added
55+
56+
- Added `Mapping` and `mapping_factory`.
57+
58+
### Changed
59+
60+
- Variable `test_cfg` renamed to `QA_GLOBALS`.
61+
62+
## [0.16.0] - 2022-06-19
63+
64+
### Added
65+
66+
- Added support for configuration of tests. A `configparser.ConfigParser` instance is
67+
available as `test_cfg`. This instance is initialized with values from file `test_config.ini`
68+
located in `files` subdirectory.
69+
70+
## [0.15.2] - 2022-06-13
71+
72+
### Fixed
73+
74+
- Fix problem with database init script. Now it uses the database charset instead default
75+
UTF8. The UTF8 is used only when database charset is not specified.
76+
77+
78+
## [0.15.1] - 2022-06-08
79+
80+
### Added
81+
82+
- Added `encryption` marker to mark test as requiring the encryption plugin
83+
84+
### Changed
85+
86+
- Package `psutil` is now a dependency, installed automatically with plugin.
87+
88+
## [0.15.0] - 2022-06-05
89+
90+
### Added
91+
92+
- Added possibility to use databases aliases. The `db_factory()` parameter `filename` is
93+
now handled as database alias if it starts with `#`, for example `#employee` means alias
94+
`employee`. The alias must be defined in `databases.conf` file.
95+
96+
When filename is an alias, the `Database.db_path` property does not contain
97+
full `pathlib.Path` to the database, but this database alias.
98+
99+
### Changed
100+
101+
- To simplify portable use of databases with special configuration via `databases.conf`,
102+
the plugin initialization now ensures empty subdirectory `QA` in Firebird sample directory.
103+
To define your test databases in `databases.conf`, use next pattern:
104+
105+
```
106+
my_db = $(dir_sampleDB)/QA/my-db.fdb
107+
{
108+
...
109+
}
110+
```
111+
112+
On plugin initialization, the `QA` sub-directory is first emptied and removed, and then
113+
newly created. On non-Windows, full privileges are granted.
114+
115+
116+
## [0.14.0] - 2022-05-12
117+
118+
### Added
119+
120+
- Added possibility to specify user, password and role in `Action.connect_server()` and
121+
`.Action.trace()`
122+
123+
### Changed
124+
125+
- DataList is now generic class.
126+
- DataList.extract() has new 'copy' argument.
127+
128+
## [0.13.1] - 2022-05-12
129+
130+
### Fixed
131+
132+
- Fixed problem with service encoding
133+
- Fixed problem with tags in User
134+
135+
## [0.13.0] - 2022-04-19
136+
137+
### Added
138+
139+
- Explicit `Optional` typing.
140+
- Added support for both `encoding` and `encoding_errors` in `Action.connect_server()`
141+
and `Action.trace()`.
142+
143+
## [0.12.1] - 2022-02-24
144+
145+
Initial release.
146+

PLUGIN-README.md

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
# pytest plugin for Firebird QA
2+
3+
## Installation
4+
5+
If you plan to use this plugin for personal purposes (not related to Firebird project QA),
6+
we recommend to use `pipx` to install `pytest` together with `firebird-qa` plugin:
7+
8+
```
9+
pipx install pytest
10+
pipx inject pytest firebird-qa
11+
```
12+
13+
## Configuration
14+
15+
### Firebird-driver configuration
16+
17+
The QA plugin uses firebird-driver to access the Firebird servers, and uses driver configuration
18+
object to set up various driver and server/database connection parameters. The configuration object
19+
is initialized from `firebird-driver.conf` file, and plugin specifically utilizes server sections
20+
in this file. When pytest is invoked, you must specify tested server with `–server <name>` option,
21+
where `<name>` is name of server configuration section in `firebird-driver.conf` file.
22+
23+
This file is stored in firebird-qa repository, and defines default configuration suitable to most QA setups.
24+
25+
Note:
26+
27+
The `firebird-driver.conf` file should be located in QA root directory. In default setup, the QA plugin
28+
is used to test local Firebird installation with default user name and password (SYSDBA/masterkey)
29+
via local server (configuration section).
30+
31+
Important:
32+
33+
The firebird-driver currently does not support specification of client library in server sections.
34+
However, the QA plugin works around that limitation. If server section for tested server contains
35+
`fb_client_library` option specification, it’s copied to global setting.
36+
37+
See configuration chapter in [driver documentation](https://firebird-driver.readthedocs.io) for details.
38+
39+
### Pytest configuration
40+
41+
While it’s not required, it’s recommended to create pytest configuration file in QA root directory.
42+
You may use this file to simplify your use of pytest with addopts option, or adjust pytest behaviour.
43+
44+
Suggested options for `pytest.ini`:
45+
```
46+
console_output_style = count
47+
testpaths = tests
48+
addopts = --server local --install-terminal
49+
```
50+
51+
## Running test for Firebird
52+
53+
To run all tests in suite against local Firebird server, invoke:
54+
```
55+
pytest --server local ./tests
56+
```
57+
58+
Tip: If you created `pytest.ini` with recommended values, you can just invoke pytest without additional parameters.
59+
60+
### pytest report header
61+
62+
When pytest is invoked, a report header is printed on terminal before individual tests are executed.
63+
The QA plugin extend this header with next information:
64+
65+
- Python encodings
66+
67+
- system
68+
- locale
69+
- filesystem
70+
71+
- Information about tested Firebird server
72+
73+
- conf. section name
74+
- version
75+
- mode
76+
- architecture
77+
- home directory
78+
- tools directory
79+
- used client library
80+
81+
### pytest switches installed by QA plugin
82+
83+
The QA plugin installs several pytest command-line switches. When you run pytest ``--help``,
84+
they are listed in Firebird QA section:
85+
```
86+
Firebird QA:
87+
--server=SERVER Server configuration name
88+
--bin-dir=PATH Path to directory with Firebird utilities
89+
--protocol={xnet,inet,inet4,wnet}
90+
Network protocol used for database attachments
91+
--runslow Run slow tests
92+
--save-output Save test std[out|err] output to files
93+
--skip-deselected={platform,version,any}
94+
SKIP tests instead deselection
95+
--extend-xml Extend XML JUnit report with additional information
96+
--install-terminal Use our own terminal reporter
97+
```
98+
99+
**server:**
100+
101+
REQUIRED option. Section name in firebird-driver.conf with connection parameters for tested server.
102+
103+
**bin-dir:**
104+
105+
Normally, the QA plugin detects and properly sets the directory where Firebird tools are installed.
106+
However, you can set this directory explicitly using the --bin-dir switch.
107+
108+
**protocol:**
109+
110+
Override for network protocol specified in firebird-driver.conf file (or default).
111+
112+
**runslow:**
113+
114+
Tests that run for longer than 10 minutes on equipment used for regular Firebird QA should be
115+
marked as slow. They are not executed, unless this switch is specified.
116+
117+
**save-output:**
118+
119+
_Experimental switch_
120+
121+
When this switch is specified, stdout/stderr output of external Firebird tool executed by
122+
test is stored in `/out` subdirectory. Intended for test debugging.
123+
124+
**skip-deselected:**
125+
126+
Tests that are not applicable to tested server (because they are for specific platform or
127+
Firebird versions) are deselected during pytest collection phase. It means that they are not
128+
shown in test session report. This switch changes the routine, so tests are marked to skip
129+
(with message explaining why) instead deselection, so they show up is session report.
130+
131+
**extend-xml:**
132+
133+
When this switch is used together with `--junitxml` switch, the produced JUnitXML file will
134+
contain additional metadata for testsuite and testcase elements recorded as property sub-elements.
135+
136+
**Important:**
137+
138+
Please note that using this feature will break schema verifications for the latest JUnitXML schema.
139+
This might be a problem when used with some CI servers.
140+
141+
**install-terminal:**
142+
143+
This option changes default pytest terminal reporter that displays pytest NODE IDs, to custom
144+
reporter that displays Firebord QA test IDs.
145+
146+
pytest node IDs are of the form `module.py::class::method` or `module.py::function`.
147+
148+
Firebord QA test IDs are defined in our test metadata.
149+
150+
**Important:**
151+
152+
Right now, the custom terminal is opt-in feature. This will be changed in some future release
153+
to opt-out using new switch.
154+
155+
156+
### Test for use with this plugin
157+
158+
Please read the [plugin documentation](https://firebird-qa.rtfd.io) for instructions how
159+
to create tests that use special support provided by this plugin.

0 commit comments

Comments
 (0)