Skip to content

Commit

Permalink
Merge branch 'main' into romain.komorn/SDTEST-225/use_bytearrays_for_…
Browse files Browse the repository at this point in the history
…coverage
  • Loading branch information
romainkomorndatadog authored Aug 26, 2024
2 parents bfa0678 + 94f93ed commit 9501af1
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 37 deletions.
80 changes: 48 additions & 32 deletions .github/workflows/system-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,37 @@ jobs:
python -c "import os,sys,fnmatch;sys.exit(not bool([_ for pattern in {'ddtrace/*', 'setup*', 'pyproject.toml', '.github/workflows/system-tests.yml'} for _ in fnmatch.filter(os.environ['PATHS'].splitlines(), pattern)]))"
continue-on-error: true

system-tests-build:
system-tests-build-agent:
runs-on: ubuntu-latest
needs: needs-run
steps:

- name: Checkout system tests
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
uses: actions/checkout@v4
with:
repository: 'DataDog/system-tests'

- name: Build agent
id: build
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
run: ./build.sh -i agent

- name: Save
id: save
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
run: |
docker image save system_tests/agent:latest | gzip > agent_${{ github.sha }}.tar.gz
- uses: actions/upload-artifact@v4
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
with:
name: agent_${{ github.sha }}
path: |
agent_${{ github.sha }}.tar.gz
retention-days: 2

system-tests-build-weblog:
runs-on: ubuntu-latest
needs: needs-run
strategy:
Expand All @@ -46,11 +76,6 @@ jobs:
DD_API_KEY: 1234567890abcdef1234567890abcdef
CMAKE_BUILD_PARALLEL_LEVEL: 12
steps:
- name: Setup python 3.12
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Checkout system tests
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
Expand All @@ -71,28 +96,25 @@ jobs:
- name: Build
id: build
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
run: ./build.sh
run: ./build.sh -i weblog

- name: Save
id: save
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
run: |
docker image save system_tests/weblog:latest | gzip > ${{ matrix.weblog-variant}}_weblog_${{ github.sha }}.tar.gz
docker image save system_tests/agent:latest | gzip > ${{ matrix.weblog-variant}}_agent_${{ github.sha }}.tar.gz
- uses: actions/upload-artifact@v4
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
with:
name: ${{ matrix.weblog-variant }}_${{ github.sha }}
path: |
${{ matrix.weblog-variant}}_weblog_${{ github.sha }}.tar.gz
${{ matrix.weblog-variant}}_agent_${{ github.sha }}.tar.gz
venv
retention-days: 2

system-tests:
runs-on: ubuntu-latest
needs: [needs-run, system-tests-build]
needs: [needs-run, system-tests-build-agent, system-tests-build-weblog]
strategy:
matrix:
weblog-variant: [flask-poc, uwsgi-poc , django-poc, fastapi, python3.12]
Expand All @@ -108,35 +130,33 @@ jobs:
DD_API_KEY: 1234567890abcdef1234567890abcdef
CMAKE_BUILD_PARALLEL_LEVEL: 12
steps:
- name: Setup python 3.12
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Checkout system tests
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
uses: actions/checkout@v4
with:
repository: 'DataDog/system-tests'

- name: Build runner
uses: ./.github/actions/install_runner

- uses: actions/download-artifact@v4
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
with:
name: ${{ matrix.weblog-variant }}_${{ github.sha }}
path: ${{ matrix.weblog-variant}}_${{ github.sha }}.tar.gz
path: images_artifacts/

- name: docker load
- uses: actions/download-artifact@v4
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
run: |
docker load < ${{ matrix.weblog-variant}}_${{ github.sha }}.tar.gz/${{ matrix.weblog-variant}}_weblog_${{ github.sha }}.tar.gz
docker load < ${{ matrix.weblog-variant}}_${{ github.sha }}.tar.gz/${{ matrix.weblog-variant}}_agent_${{ github.sha }}.tar.gz
with:
name: agent_${{ github.sha }}
path: images_artifacts/

- name: move venv
- name: docker load
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
run: |
mv ${{ matrix.weblog-variant}}_${{ github.sha }}.tar.gz/venv venv
chmod -R +x venv/bin/*
docker load < images_artifacts/${{ matrix.weblog-variant}}_weblog_${{ github.sha }}.tar.gz
docker load < images_artifacts/agent_${{ github.sha }}.tar.gz
- name: Run DEFAULT
if: (needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule') && matrix.scenario == 'other'
Expand Down Expand Up @@ -237,7 +257,8 @@ jobs:


parametric:
runs-on: ubuntu-latest
runs-on:
group: "APM Larger Runners"
needs: needs-run
env:
TEST_LIBRARY: python
Expand All @@ -254,14 +275,9 @@ jobs:
path: 'binaries/dd-trace-py'
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- uses: actions/setup-python@v5
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
with:
python-version: '3.12'

- name: Build
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
run: ./build.sh -i runner
- name: Build runner
uses: ./.github/actions/install_runner

- name: Run
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
Expand Down
6 changes: 1 addition & 5 deletions tests/appsec/iast_packages/test_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def uninstall(self, python_cmd):
"xn--eckwd4c7c.xn--zckzah",
import_module_to_validate="idna.codec",
test_propagation=True,
fixme_propagation_fails=True,
fixme_propagation_fails=False,
),
PackageForTesting(
"importlib-resources",
Expand Down Expand Up @@ -504,7 +504,6 @@ def uninstall(self, python_cmd):
"",
import_module_to_validate="rsa.pkcs1",
test_propagation=True,
fixme_propagation_fails=False,
),
PackageForTesting(
"sqlalchemy",
Expand Down Expand Up @@ -585,7 +584,6 @@ def uninstall(self, python_cmd):
extras=[("beautifulsoup4", "4.12.3")],
skip_python_version=[(3, 6), (3, 7), (3, 8)],
test_propagation=True,
fixme_propagation_fails=True,
),
PackageForTesting(
"werkzeug",
Expand All @@ -606,7 +604,6 @@ def uninstall(self, python_cmd):
import_module_to_validate="yarl._url",
skip_python_version=[(3, 6), (3, 7), (3, 8)],
test_propagation=True,
fixme_propagation_fails=True,
),
PackageForTesting(
"zipp",
Expand Down Expand Up @@ -679,7 +676,6 @@ def uninstall(self, python_cmd):
"",
skip_python_version=[(3, 8)],
test_propagation=True,
fixme_propagation_fails=True,
),
## TODO: https://datadoghq.atlassian.net/browse/APPSEC-53659
## Disabled due to a bug in CI:
Expand Down

0 comments on commit 9501af1

Please sign in to comment.