1{ lib
2, buildPythonPackage
3, fetchPypi
4, mock
5, oslo-concurrency
6, oslo-db
7, pbr
8, python-dateutil
9, stestr
10}:
11
12buildPythonPackage rec {
13 pname = "subunit2sql";
14 version = "1.10.0";
15
16 src = fetchPypi {
17 inherit pname version;
18 hash = "sha256-c+Dg6moKiv30M0mmwGQSOEbc94gfH//ZnF7lnBgv8EU=";
19 };
20
21 propagatedBuildInputs = [
22 oslo-db
23 pbr
24 python-dateutil
25 ];
26
27 nativeCheckInputs = [
28 mock
29 oslo-concurrency
30 stestr
31 ];
32
33 checkPhase = ''
34 export PATH=$out/bin:$PATH
35 export HOME=$TMPDIR
36
37 stestr run -e <(echo "
38 subunit2sql.tests.db.test_api.TestDatabaseAPI.test_get_failing_test_ids_from_runs_by_key_value
39 subunit2sql.tests.db.test_api.TestDatabaseAPI.test_get_id_from_test_id
40 subunit2sql.tests.db.test_api.TestDatabaseAPI.test_get_test_run_dict_by_run_meta_key_value
41 subunit2sql.tests.migrations.test_migrations.TestWalkMigrations.test_sqlite_opportunistically
42 subunit2sql.tests.test_shell.TestMain.test_main
43 subunit2sql.tests.test_shell.TestMain.test_main_with_targets
44 ")
45 '';
46
47 pythonImportsCheck = [ "subunit2sql" ];
48
49 meta = with lib; {
50 description = "Command to Read a subunit file or stream and put the data in a SQL DB";
51 homepage = "https://opendev.org/opendev/subunit2sql";
52 license = licenses.asl20;
53 maintainers = teams.openstack.members;
54 };
55}