Skip to content

Commit

Permalink
Update the testwasher to use the generated config
Browse files Browse the repository at this point in the history
  • Loading branch information
chouetz committed Oct 16, 2024
1 parent 08ed25a commit 6dcdc38
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitlab/e2e/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ generate-flakes-finder-pipeline:
- !reference [.on_deploy_nightly_repo_branch]
- !reference [.manual]
needs:
- compute_gitlab_ci_config
- deploy_deb_testing-a7_arm64
- deploy_deb_testing-a7_x64
- deploy_rpm_testing-a7_arm64
Expand Down
19 changes: 14 additions & 5 deletions tasks/testwasher.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

import copy
import json
import os
from collections import defaultdict

import yaml
from invoke import task
from invoke import Exit, task

from tasks.libs.ciproviders.gitlab_api import (
resolve_gitlab_ci_configuration,
Expand Down Expand Up @@ -128,13 +129,21 @@ def process_module_results(self, module_results: list[ModuleTestResult]):


@task
def generate_flake_finder_pipeline(ctx, n=3):
def generate_flake_finder_pipeline(ctx, n=3, generate_config=False):
"""
Generate a child pipeline where jobs marked with SHOULD_RUN_IN_FLAKES_FINDER are run n times
"""

# Read gitlab config
config = resolve_gitlab_ci_configuration(ctx, ".gitlab-ci.yml", with_lint=False)
if generate_config:
# Read gitlab config
config = resolve_gitlab_ci_configuration(ctx, ".gitlab-ci.yml")
else:
# Read gitlab config, which is computed and stored in compute_gitlab_ci_config job
if not os.path.exists("artifacts/after.gitlab-ci.yml"):
raise Exit(
"The configuration is not stored as artifact. Please ensure you ran the compute_gitlab_ci_config job, or set generate_config to True"
)
with open("artifacts/after.gitlab-ci.yml") as f:
config = yaml.safe_load(f)[".gitlab-ci.yml"]

# Lets keep only variables and jobs with flake finder variable
kept_job = {}
Expand Down

0 comments on commit 6dcdc38

Please sign in to comment.