diff --git a/.circleci/config.templ.yml b/.circleci/config.templ.yml index 73994eab222..05da52d643a 100644 --- a/.circleci/config.templ.yml +++ b/.circleci/config.templ.yml @@ -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 diff --git a/hatch.toml b/hatch.toml index 1f073332547..41e5d049e60 100644 --- a/hatch.toml +++ b/hatch.toml @@ -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] diff --git a/scripts/gen_gitlab_config.py b/scripts/gen_gitlab_config.py index 8dc9e5b178f..96dfd5a4ff0 100644 --- a/scripts/gen_gitlab_config.py +++ b/scripts/gen_gitlab_config.py @@ -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 = [] @@ -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}") diff --git a/tests/appsec/suitespec.yml b/tests/appsec/suitespec.yml index e2b15e2336c..867a1a46d54 100644 --- a/tests/appsec/suitespec.yml +++ b/tests/appsec/suitespec.yml @@ -74,7 +74,7 @@ suites: retry: 2 runner: hatch appsec_iast_packages: - parallelism: 5 + parallelism: 4 paths: - '@bootstrap' - '@core' @@ -84,8 +84,11 @@ suites: - '@remoteconfig' - tests/appsec/iast/* - tests/appsec/iast_packages/* - runner: riot - snapshot: true + retry: 2 + runner: hatch + timeout: 50m + only: + - 'main' appsec_integrations: parallelism: 7 paths: