Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: retry tests to reduce flakyness #836

Merged
merged 2 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 24 additions & 47 deletions integrations/amazon_bedrock/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ readme = "README.md"
requires-python = ">=3.8"
license = "Apache-2.0"
keywords = []
authors = [
{ name = "deepset GmbH", email = "[email protected]" },
]
authors = [{ name = "deepset GmbH", email = "[email protected]" }]
classifiers = [
"License :: OSI Approved :: Apache Software License",
"Development Status :: 4 - Beta",
Expand All @@ -25,11 +23,7 @@ classifiers = [
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"haystack-ai",
"boto3>=1.28.57",
"transformers"
]
dependencies = ["haystack-ai", "boto3>=1.28.57", "transformers"]

[project.urls]
Documentation = "https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/amazon_bedrock#readme"
Expand All @@ -51,50 +45,29 @@ git_describe_command = 'git describe --tags --match="integrations/amazon_bedrock
dependencies = [
"coverage[toml]>=6.5",
"pytest",
"pytest-rerunfailures",
"haystack-pydoc-tools",
]
[tool.hatch.envs.default.scripts]
test = "pytest {args:tests}"
test = "pytest --reruns 3 --reruns-delay 30 -x {args:tests}"
test-cov = "coverage run -m pytest {args:tests}"
cov-report = [
"- coverage combine",
"coverage report",
]
cov = [
"test-cov",
"cov-report",
]
docs = [
"pydoc-markdown pydoc/config.yml"
]
cov-report = ["- coverage combine", "coverage report"]
cov = ["test-cov", "cov-report"]
docs = ["pydoc-markdown pydoc/config.yml"]
[[tool.hatch.envs.all.matrix]]
python = ["3.8", "3.9", "3.10", "3.11", "3.12"]

[tool.hatch.envs.lint]
detached = true
dependencies = [
"black>=23.1.0",
"mypy>=1.0.0",
"ruff>=0.0.243",
]
dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"]
[tool.hatch.envs.lint.scripts]
typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}"

style = [
"ruff {args:.}",
"black --check --diff {args:.}",
]
style = ["ruff {args:.}", "black --check --diff {args:.}"]

fmt = [
"black {args:.}",
"ruff --fix {args:.}",
"style",
]
fmt = ["black {args:.}", "ruff --fix {args:.}", "style"]

all = [
"style",
"typing",
]
all = ["style", "typing"]

[tool.black]
target-version = ["py38"]
Expand Down Expand Up @@ -134,11 +107,19 @@ ignore = [
# Allow non-abstract empty methods in abstract base classes
"B027",
# Ignore checks for possible passwords
"S105", "S106", "S107",
"S105",
"S106",
"S107",
# Ignore complexity
"C901", "PLR0911", "PLR0912", "PLR0913", "PLR0915",
"C901",
"PLR0911",
"PLR0912",
"PLR0913",
"PLR0915",
# Ignore unused params
"ARG001", "ARG002", "ARG005",
"ARG001",
"ARG002",
"ARG005",
]
unfixable = [
# Don't touch unused imports
Expand All @@ -162,12 +143,8 @@ parallel = true

[tool.coverage.report]
omit = ["*/tests/*", "*/__init__.py"]
show_missing=true
exclude_lines = [
"no cov",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]
show_missing = true
exclude_lines = ["no cov", "if __name__ == .__main__.:", "if TYPE_CHECKING:"]

[[tool.mypy.overrides]]
module = [
Expand Down
67 changes: 21 additions & 46 deletions integrations/amazon_sagemaker/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ readme = "README.md"
requires-python = ">=3.8"
license = "Apache-2.0"
keywords = []
authors = [
{ name = "deepset GmbH", email = "[email protected]" },
]
authors = [{ name = "deepset GmbH", email = "[email protected]" }]
classifiers = [
"License :: OSI Approved :: Apache Software License",
"Development Status :: 4 - Beta",
Expand All @@ -28,10 +26,7 @@ classifiers = [
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"haystack-ai",
"boto3>=1.28.57",
]
dependencies = ["haystack-ai", "boto3>=1.28.57"]

[project.urls]
Documentation = "https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/amazon_sagemaker_haystack#readme"
Expand All @@ -53,49 +48,28 @@ git_describe_command = 'git describe --tags --match="integrations/amazon_sagemak
dependencies = [
"coverage[toml]>=6.5",
"pytest",
"pytest-rerunfailures",
"haystack-pydoc-tools",
]
[tool.hatch.envs.default.scripts]
test = "pytest {args:tests}"
test = "pytest --reruns 3 --reruns-delay 30 -x {args:tests}"
test-cov = "coverage run -m pytest {args:tests}"
cov-report = [
"- coverage combine",
"coverage report",
]
cov = [
"test-cov",
"cov-report",
]
cov-report = ["- coverage combine", "coverage report"]
cov = ["test-cov", "cov-report"]

docs = [
"pydoc-markdown pydoc/config.yml"
]
docs = ["pydoc-markdown pydoc/config.yml"]

[[tool.hatch.envs.all.matrix]]
python = ["3.8", "3.9", "3.10", "3.11"]

[tool.hatch.envs.lint]
detached = true
dependencies = [
"black>=23.1.0",
"mypy>=1.0.0",
"ruff>=0.0.243",
]
dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"]
[tool.hatch.envs.lint.scripts]
typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}"
style = [
"ruff {args:.}",
"black --check --diff {args:.}",
]
fmt = [
"black {args:.}",
"ruff --fix {args:.}",
"style",
]
all = [
"style",
"typing",
]
style = ["ruff {args:.}", "black --check --diff {args:.}"]
fmt = ["black {args:.}", "ruff --fix {args:.}", "style"]
all = ["style", "typing"]

[tool.black]
target-version = ["py38"]
Expand Down Expand Up @@ -140,9 +114,15 @@ ignore = [
# Allow boolean positional values in function calls, like `dict.get(... True)`
"FBT003",
# Ignore checks for possible passwords
"S105", "S106", "S107",
"S105",
"S106",
"S107",
# Ignore complexity
"C901", "PLR0911", "PLR0912", "PLR0913", "PLR0915",
"C901",
"PLR0911",
"PLR0912",
"PLR0913",
"PLR0915",
]
unfixable = [
# Don't touch unused imports
Expand All @@ -166,12 +146,8 @@ parallel = true

[tool.coverage.report]
omit = ["*/tests/*", "*/__init__.py"]
show_missing=true
exclude_lines = [
"no cov",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]
show_missing = true
exclude_lines = ["no cov", "if __name__ == .__main__.:", "if TYPE_CHECKING:"]

[[tool.mypy.overrides]]
module = [
Expand All @@ -185,7 +161,6 @@ module = [
ignore_missing_imports = true



[tool.pytest.ini_options]
addopts = "--strict-markers"
markers = [
Expand Down
75 changes: 25 additions & 50 deletions integrations/anthropic/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ readme = "README.md"
requires-python = ">=3.8"
license = "Apache-2.0"
keywords = []
authors = [
{ name = "deepset GmbH", email = "[email protected]" },
]
authors = [{ name = "deepset GmbH", email = "[email protected]" }]
classifiers = [
"License :: OSI Approved :: Apache Software License",
"Development Status :: 4 - Beta",
Expand All @@ -25,10 +23,7 @@ classifiers = [
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"haystack-ai",
"anthropic",
]
dependencies = ["haystack-ai", "anthropic"]

[project.urls]
Documentation = "https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/anthropic#readme"
Expand All @@ -50,50 +45,29 @@ git_describe_command = 'git describe --tags --match="integrations/anthropic-v[0-
dependencies = [
"coverage[toml]>=6.5",
"pytest",
"pytest-rerunfailures",
"haystack-pydoc-tools",
]
[tool.hatch.envs.default.scripts]
test = "pytest {args:tests}"
test = "pytest --reruns 3 --reruns-delay 30 -x {args:tests}"
test-cov = "coverage run -m pytest {args:tests}"
cov-report = [
"- coverage combine",
"coverage report",
]
cov = [
"test-cov",
"cov-report",
]
docs = [
"pydoc-markdown pydoc/config.yml"
]
cov-report = ["- coverage combine", "coverage report"]
cov = ["test-cov", "cov-report"]
docs = ["pydoc-markdown pydoc/config.yml"]
[[tool.hatch.envs.all.matrix]]
python = ["3.8", "3.9", "3.10", "3.11", "3.12"]

[tool.hatch.envs.lint]
detached = true
dependencies = [
"black>=23.1.0",
"mypy>=1.0.0",
"ruff>=0.0.243",
]
dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"]
[tool.hatch.envs.lint.scripts]
typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}"

style = [
"ruff {args:.}",
"black --check --diff {args:.}",
]
style = ["ruff {args:.}", "black --check --diff {args:.}"]

fmt = [
"black {args:.}",
"ruff --fix {args:.}",
"style",
]
fmt = ["black {args:.}", "ruff --fix {args:.}", "style"]

all = [
"style",
"typing",
]
all = ["style", "typing"]

[tool.black]
target-version = ["py38"]
Expand Down Expand Up @@ -133,11 +107,19 @@ ignore = [
# Allow non-abstract empty methods in abstract base classes
"B027",
# Ignore checks for possible passwords
"S105", "S106", "S107",
"S105",
"S106",
"S107",
# Ignore complexity
"C901", "PLR0911", "PLR0912", "PLR0913", "PLR0915",
"C901",
"PLR0911",
"PLR0912",
"PLR0913",
"PLR0915",
# Ignore unused params
"ARG001", "ARG002", "ARG005",
"ARG001",
"ARG002",
"ARG005",
]
unfixable = [
# Don't touch unused imports
Expand All @@ -161,12 +143,8 @@ parallel = true

[tool.coverage.report]
omit = ["*/tests/*", "*/__init__.py"]
show_missing=true
exclude_lines = [
"no cov",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]
show_missing = true
exclude_lines = ["no cov", "if __name__ == .__main__.:", "if TYPE_CHECKING:"]

[[tool.mypy.overrides]]
module = [
Expand All @@ -180,8 +158,5 @@ ignore_missing_imports = true

[tool.pytest.ini_options]
addopts = "--strict-markers"
markers = [
"unit: unit tests",
"integration: integration tests",
]
markers = ["unit: unit tests", "integration: integration tests"]
log_cli = true
Loading
Loading