forked from exasol/bucketfs-utils-python
-
Notifications
You must be signed in to change notification settings - Fork 1
/
noxconfig.py
62 lines (52 loc) · 1.73 KB
/
noxconfig.py
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
57
58
59
60
61
62
from __future__ import annotations
from dataclasses import dataclass
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import (
Any,
Iterable,
MutableMapping,
)
from exasol.toolbox.nox.plugin import hookimpl
from nox import Session
class IntegrationTestsPlugin:
@hookimpl
def pre_integration_tests_hook(self, session, config, context):
with TemporaryDirectory() as tmp_dir:
tmp_dir = Path(tmp_dir)
checkout_name = "ITDE"
with session.chdir(tmp_dir):
session.run(
"git",
"clone",
"https://github.com/exasol/integration-test-docker-environment.git",
checkout_name,
)
with session.chdir(tmp_dir / checkout_name):
session.run(
"./start-test-env",
"spawn-test-environment",
"--environment-name",
"test",
"--database-port-forward",
"8888",
"--bucketfs-port-forward",
"6666",
"--db-mem-size",
"4GB",
)
@hookimpl
def post_integration_tests_hook(self, session, config, context):
session.run("docker", "kill", "db_container_test", external=True)
@dataclass(frozen=True)
class Config:
root: Path = Path(__file__).parent
doc: Path = Path(__file__).parent / "doc"
version_file: Path = Path(__file__).parent / "exasol" / "bucketfs" / "version.py"
path_filters: Iterable[str] = (
"dist",
".eggs",
"venv",
)
plugins = [IntegrationTestsPlugin]
PROJECT_CONFIG = Config()