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

Override the default test options for some integrations #15779

Merged
merged 1 commit into from
Sep 8, 2023

Conversation

FlorentClarret
Copy link
Member

@FlorentClarret FlorentClarret commented Sep 7, 2023

What does this PR do?

Fix stuff coming from #15762

  • Add more pytest options to some integrations that require it
  • Run all tests when ddev is modified
  • Move most of the command overrides to either pyproject.toml (for python3) or setup.cfg (for py2)

Motivation

https://github.com/DataDog/integrations-core/actions/runs/6105895055/job/16570096990

When we add parameters after

base_command.extend(('--', 'test-cov' if coverage else 'test'))

, they will be forward to

https://github.com/DataDog/integrations-core/blob/master/ddev/src/ddev/plugin/external/hatch/environment_collector.py#L114-L119 as args and we loose the tests part of the command, which make us load everything.

Trigger all the tests when ddev is modified, similar to what we do with datadog_checks_dev.

Additional Notes

Adding a default setup.cfg file at the root does not work (I might have a look at that a bit later, my priority is to have our CI green)

I'll open follow-up PRs to configure this by default for most of the integrations.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Changelog entries must be created for modifications to shipped code
  • Add the qa/skip-qa label if the PR doesn't need to be tested during QA.

@codecov
Copy link

codecov bot commented Sep 7, 2023

Codecov Report

Merging #15779 (cd9ad6b) into master (3567074) will decrease coverage by 0.25%.
Report is 1 commits behind head on master.
The diff coverage is n/a.

Flag Coverage Δ
confluent_platform ?
datadog_checks_dev 82.51% <ø> (+0.07%) ⬆️
datadog_checks_downloader 81.65% <ø> (ø)
hudi ?
teamcity 88.74% <ø> (+3.21%) ⬆️
weblogic ?
win32_event_log 42.71% <ø> (-43.42%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

📢 Have feedback on the report? Share it here.

@github-actions
Copy link

github-actions bot commented Sep 7, 2023

Test Results

     14 files       14 suites   8m 58s ⏱️
   483 tests    482 ✔️     1 💤 0
1 118 runs  1 003 ✔️ 115 💤 0

Results for commit cd9ad6b.

♻️ This comment has been updated with latest results.

@ghost ghost added the dev_package label Sep 7, 2023
@FlorentClarret FlorentClarret changed the title florentclarret/ddev/load conftest files Fix the datadog_checks_dev tests Sep 7, 2023
@FlorentClarret FlorentClarret force-pushed the florentclarret/ddev/load_conftest_files branch from dd1f476 to 27526e5 Compare September 7, 2023 09:12
@ghost ghost added the documentation label Sep 7, 2023
@FlorentClarret FlorentClarret force-pushed the florentclarret/ddev/load_conftest_files branch from 27526e5 to 3e35436 Compare September 7, 2023 09:16
@FlorentClarret FlorentClarret marked this pull request as ready for review September 7, 2023 09:27
@FlorentClarret FlorentClarret requested review from a team as code owners September 7, 2023 09:27
Copy link
Contributor

@iliakur iliakur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch!

@@ -14,6 +14,7 @@ matrix.impl.env-vars = [
]
matrix.python.scripts = [
{ key = "test", value = "_dd-test --ignore=tests/docker" },
{ key = "test-cov", value = "_dd-test-cov --ignore=tests/docker" },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we set this flag in a conftest.py or even pyproject.toml? That way it would apply always.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know 😅 Will wait for ofek on this one if that's ok for you

Copy link
Contributor

@iliakur iliakur Sep 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea, looking forward to Ofek's input! iiuc, putting it into config could mean we get rid of that whole section!

ddev/CHANGELOG.md Outdated Show resolved Hide resolved
@FlorentClarret FlorentClarret force-pushed the florentclarret/ddev/load_conftest_files branch 7 times, most recently from 26ae1b3 to 402579a Compare September 7, 2023 14:55
@FlorentClarret FlorentClarret changed the title Fix the datadog_checks_dev tests --ignore=tests/docker Sep 7, 2023
@FlorentClarret FlorentClarret force-pushed the florentclarret/ddev/load_conftest_files branch 2 times, most recently from 0739bc5 to 5225655 Compare September 7, 2023 15:26
@FlorentClarret FlorentClarret changed the title --ignore=tests/docker Override the default test options for some integrations Sep 7, 2023
@FlorentClarret FlorentClarret force-pushed the florentclarret/ddev/load_conftest_files branch 2 times, most recently from 52ee109 to 4cf507b Compare September 7, 2023 15:56
rtrieu
rtrieu previously approved these changes Sep 7, 2023
Copy link
Contributor

@rtrieu rtrieu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@FlorentClarret FlorentClarret force-pushed the florentclarret/ddev/load_conftest_files branch from f6ea985 to cd9ad6b Compare September 8, 2023 06:06
Copy link
Contributor

@julien-lebot julien-lebot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved for the Windows Agent owned files

@FlorentClarret FlorentClarret merged commit 9612756 into master Sep 8, 2023
@FlorentClarret FlorentClarret deleted the florentclarret/ddev/load_conftest_files branch September 8, 2023 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants