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

chore(iast): migrate test packages to gitlab #11827

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
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
13 changes: 0 additions & 13 deletions .circleci/config.templ.yml
Original file line number Diff line number Diff line change
Expand Up @@ -404,19 +404,6 @@ jobs:
paths:
- "."

appsec_iast_packages:
<<: *machine_executor
parallelism: 5
steps:
- when:
condition:
matches: { pattern: "main", value: << pipeline.git.branch >> }
steps:
- run_test:
pattern: 'appsec_iast_packages'
snapshot: true
- run: echo "This test is skipped outside of main branch"

appsec_integrations:
<<: *machine_executor
parallelism: 13
Expand Down
26 changes: 26 additions & 0 deletions hatch.toml
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,32 @@ test = [
[[envs.appsec_iast_native.matrix]]
python = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]

## ASM appsec_iast_packages

[envs.appsec_iast_packages]
template = "appsec_iast_packages"
dependencies = [
"pytest",
"pytest-cov",
"requests",
"hypothesis",
"requests",
"astunparse",
"flask",
"virtualenv-clone"
]

[envs.appsec_iast_packages.scripts]
test = [
"uname -a",
"pip freeze",
"DD_CIVISIBILITY_ITR_ENABLED=0 DD_IAST_REQUEST_SAMPLING=100 _DD_APPSEC_DEDUPLICATION_ENABLED=false python -m pytest tests/appsec/iast_packages",
]

[[envs.appsec_iast_packages.matrix]]
python = ["3.9", "3.10", "3.11", "3.12"]


## ASM FastAPI

[envs.appsec_threats_fastapi]
Expand Down
6 changes: 6 additions & 0 deletions scripts/gen_gitlab_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class JobSpec:
timeout: t.Optional[int] = None
skip: bool = False
paths: t.Optional[t.Set[str]] = None # ignored
only: t.Optional[t.Set[str]] = None # ignored

def __str__(self) -> str:
lines = []
Expand Down Expand Up @@ -60,6 +61,11 @@ def __str__(self) -> str:
for key, value in env.items():
lines.append(f" {key}: {value}")

if self.only:
lines.append(" only:")
for value in self.only:
lines.append(f" - {value}")

if self.parallelism is not None:
lines.append(f" parallel: {self.parallelism}")

Expand Down
9 changes: 6 additions & 3 deletions tests/appsec/suitespec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ suites:
retry: 2
runner: hatch
appsec_iast_packages:
parallelism: 5
parallelism: 4
paths:
- '@bootstrap'
- '@core'
Expand All @@ -84,8 +84,11 @@ suites:
- '@remoteconfig'
- tests/appsec/iast/*
- tests/appsec/iast_packages/*
runner: riot
snapshot: true
retry: 2
runner: hatch
timeout: 50m
avara1986 marked this conversation as resolved.
Show resolved Hide resolved
only:
- 'main'
appsec_integrations:
parallelism: 7
paths:
Expand Down
Loading