Skip to content

Dynamically compute scenarios to run#2408

Merged
cbeauchesne merged 22 commits intomainfrom
cbeauchesne/compute-scnearios
May 3, 2024
Merged

Dynamically compute scenarios to run#2408
cbeauchesne merged 22 commits intomainfrom
cbeauchesne/compute-scnearios

Conversation

@cbeauchesne
Copy link
Copy Markdown
Collaborator

@cbeauchesne cbeauchesne commented Apr 29, 2024

Motivation

Changes

  1. compute scenarios to run based on modifications on manifests
    • get the map of test_method -> attached scenario
    • get the list of modified node in manifest
    • on each modified node, get attached scenarios to run
  2. compute scenarios to run based on modifications in tests/ folder
    • get the list of modified file
    • with the map above, get the attached scenarios to run
    • ⚠️ it may run more scenario than necessary, but it's better than running all of them
  3. modify the CI API
    • rather having a run-scenario-group inputs (lot of them), uses two inputs:
    • scenarios: a list of scenario to run
    • scenarios_groups: a list of scenario groups to run
    • define scenarios_groups a the scneario level
    • and add script that build a list of scenario based on scenarios_groups

Last note, scenarios and scenarios_groups are strings, in JSON format, like '["AAA", "BBB"]'. I choose this foirmat, rather a simple comma separated list, to be able to easily use them as matrix inputs in a near future.

Edit: Actually use a comma separated list : those inputs needs to be computed by a script, so, technically JSON and a comma-separated list are equally simple. But the second is easier to use for system-tests.yml API.

Workflow

  1. ⚠️ Create your PR as draft ⚠️
  2. Work on you PR until the CI passes (if something not related to your task is failing, you can ignore it)
  3. Mark it as ready for review
    • Test logic is modified? -> Get a review from RFC owner. We're working on refining the codeowners file quickly.
    • Framework is modified, or non obvious usage of it -> get a review from R&P team

🚀 Once your PR is reviewed, you can merge it!

🛟 #apm-shared-testing 🛟

Reviewer checklist

  • Relevant label (run-parametric-scenario, run-profiling-scenario...) are presents
  • If PR title starts with [<language>], double-check that only <language> is impacted by the change
  • No system-tests internal is modified. Otherwise, I have the approval from R&P team
  • CI is green, or failing jobs are not related to this change (and you are 100% sure about this statement)
  • A docker base image is modified?
    • the relevant build-XXX-image label is present
  • A scenario is added (or removed)?

@cbeauchesne cbeauchesne changed the title Cbeauchesne/compute scnearios Dynamically compute scenarios to run Apr 29, 2024
@cbeauchesne cbeauchesne force-pushed the cbeauchesne/compute-scnearios branch from d688e86 to 60cba62 Compare April 29, 2024 17:07
@cbeauchesne cbeauchesne force-pushed the cbeauchesne/compute-scnearios branch from 60cba62 to d685d07 Compare April 29, 2024 17:08
@cbeauchesne cbeauchesne force-pushed the cbeauchesne/compute-scnearios branch from d7fa329 to 4513ae4 Compare April 29, 2024 19:02
@cbeauchesne cbeauchesne force-pushed the cbeauchesne/compute-scnearios branch from 4513ae4 to 372e143 Compare April 29, 2024 19:05
@cbeauchesne cbeauchesne force-pushed the cbeauchesne/compute-scnearios branch from d3ab73c to 089c6f3 Compare May 2, 2024 08:00
@cbeauchesne cbeauchesne marked this pull request as ready for review May 2, 2024 15:09
@cbeauchesne cbeauchesne requested a review from a team as a code owner May 2, 2024 15:09
Copy link
Copy Markdown
Collaborator

@robertomonteromiguel robertomonteromiguel left a comment

Choose a reason for hiding this comment

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

I added some comments/questions.
I think this PR is good for our CI performance, but I also think we are adding a lot of complexity to our pipeline.

Comment thread utils/scripts/compute_impacted_scenario.py Outdated
Comment thread utils/scripts/compute_impacted_scenario.py
Comment thread utils/scripts/compute_impacted_scenario.py
Comment thread utils/scripts/get_github_scenario_map.py Outdated
Comment thread utils/_context/_scenarios.py
Comment thread conftest.py
@cbeauchesne
Copy link
Copy Markdown
Collaborator Author

Last note, scenarios and scenarios_groups are strings, in JSON format, like '["AAA", "BBB"]'. I choose this foirmat, rather a simple comma separated list, to be able to easily use them as matrix inputs in a near future.

Edit: Actually use a comma separated list : those inputs needs to be computed by a script, so, technically JSON and a comma-separated list are equally simple. But the second is easier to use for system-tests.yml API.

@cbeauchesne cbeauchesne merged commit 362a78a into main May 3, 2024
@cbeauchesne cbeauchesne deleted the cbeauchesne/compute-scnearios branch May 3, 2024 13:43
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.

2 participants