Skip to content

Commit

Permalink
add Datadog CI agent (#615)
Browse files Browse the repository at this point in the history
* add Datadog CI agent (#606)

* add Datadog CI agent

* add datadog tracer to pytest command in jenkinsfile

* update action

* use `ddtrace`

* use v1 tag

* set environment variables

* use broader filename

* only run Datadog agent on Linux runners
  • Loading branch information
zacharyburnett authored Dec 19, 2022
1 parent fb7f84c commit 4ddb138
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/roman_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ jobs:
os: ubuntu-latest
python-version: '3.8'
steps:
- if: contains(runner.os, 'Linux')
uses: datadog/agent-github-action@v1
with:
api_key: ${{ secrets.DD_API_KEY }}
env:
DD_INSIDE_CI: true
DD_HOSTNAME: none
- uses: actions/checkout@v3
with:
fetch-depth: 0
Expand All @@ -102,8 +109,8 @@ jobs:
with:
path: ${{ env.CRDS_PATH }}
key: crds-${{ steps.crds-context.outputs.pmap }}
- run: tox -e ${{ matrix.toxenv }}
- if: ${{ contains(matrix.toxenv,'-cov') }}
- run: tox -e ${{ matrix.toxenv }}-ddtrace
- if: contains(matrix.toxenv, '-cov')
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
Expand Down
5 changes: 4 additions & 1 deletion JenkinsfileRT
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ env_vars = [
"CRDS_CONTEXT=roman_0039.pmap",
"CRDS_SERVER_URL=https://roman-crds-test.stsci.edu",
'CRDS_PATH=${WORKSPACE}/roman-crds-test-cache',
'DD_ENV=ci',
'DD_SERVICE=romancal',
]
if (env.ENV_VARS) {
env_vars.addAll(MultiLineToArray(env.ENV_VARS))
Expand Down Expand Up @@ -83,13 +85,14 @@ bc0.conda_packages = [
bc0.pip_reqs_files = ['requirements-sdp.txt']
bc0.build_cmds = [
"pip install -e .[test,ephem]",
"pip install pytest-xdist pytest-sugar",
"pip install pytest-xdist pytest-sugar ddtrace",
"pip freeze",
'echo "CRDS_CONTEXT = $(crds list --contexts $CRDS_CONTEXT --mappings | grep pmap)"',
]
bc0.build_cmds = PipInject(env.OVERRIDE_REQUIREMENTS) + bc0.build_cmds
bc0.test_cmds = [
"pytest --cov-report=xml --cov=./ -r sxf -n auto --bigdata --slow \
--ddtrace \
--basetemp=${pytest_basetemp} --junit-xml=results.xml --dist=loadscope \
--env=${artifactoryenv} ${pytest_args}",
'codecov --token=${codecov_token} -F nightly',
Expand Down
6 changes: 6 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,17 @@ description =
regtests: with --bigdata and --slow flags
cov: with coverage
xdist: using parallel processing
ddtrace: passing test traces to DataDog agent
passenv =
HOME
CI
TOXENV
CRDS_*
TEST_BIGDATA
CODECOV_*
setenv =
ddtrace: DD_SERVICE=romancal
ddtrace: DD_ENV=ci
args_are_paths = false
change_dir = pyargs: {homedir}
extras =
Expand All @@ -76,6 +80,7 @@ deps =
numpy120: numpy==1.20.*
numpy121: numpy==1.21.*
numpy122: numpy==1.22.*
ddtrace: ddtrace
commands_pre =
pip freeze
commands =
Expand All @@ -85,6 +90,7 @@ commands =
regtests: --bigdata --slow --basetemp={homedir}/test_outputs \
xdist: -n auto \
pyargs: {toxinidir}/docs --pyargs {posargs:romancal} \
ddtrace: --ddtrace \
{posargs}

[testenv:build-docs]
Expand Down

0 comments on commit 4ddb138

Please sign in to comment.