about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/subunit2sql/default.nix
blob: d52180a3d0c47aa21e6b7aa0a74058bf1ba3e0c1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{ lib
, buildPythonPackage
, fetchPypi
, mock
, oslo-concurrency
, oslo-db
, pbr
, python-dateutil
, stestr
}:

buildPythonPackage rec {
  pname = "subunit2sql";
  version = "1.10.0";
  format = "setuptools";

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-c+Dg6moKiv30M0mmwGQSOEbc94gfH//ZnF7lnBgv8EU=";
  };

  propagatedBuildInputs = [
    oslo-db
    pbr
    python-dateutil
  ];

  nativeCheckInputs = [
    mock
    oslo-concurrency
    stestr
  ];

  checkPhase = ''
    export PATH=$out/bin:$PATH
    export HOME=$TMPDIR

    stestr run -e <(echo "
    subunit2sql.tests.db.test_api.TestDatabaseAPI.test_get_failing_test_ids_from_runs_by_key_value
    subunit2sql.tests.db.test_api.TestDatabaseAPI.test_get_id_from_test_id
    subunit2sql.tests.db.test_api.TestDatabaseAPI.test_get_test_run_dict_by_run_meta_key_value
    subunit2sql.tests.migrations.test_migrations.TestWalkMigrations.test_sqlite_opportunistically
    subunit2sql.tests.test_shell.TestMain.test_main
    subunit2sql.tests.test_shell.TestMain.test_main_with_targets
    ")
  '';

  pythonImportsCheck = [ "subunit2sql" ];

  meta = with lib; {
    description = "Command to Read a subunit file or stream and put the data in a SQL DB";
    homepage = "https://opendev.org/opendev/subunit2sql";
    license = licenses.asl20;
    maintainers = teams.openstack.members;
  };
}