8000 Switch okify to GitHub Actions by melanieclarke · Pull Request #8762 · spacetelescope/jwst · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Switch okify to GitHub Actions #8762

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

Merged
merged 3 commits into from
Oct 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 9 additions & 18 deletions jwst/scripts/okify_regtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,9 @@
parser = ArgumentParser(description='Okify regression test results')
parser.add_argument(
'build_number',
help='Jenkins build number for JWST builds',
help='GitHub Actions build number for JWST builds',
metavar='build-number',
)
parser.add_argument(
'--job-name',
help='Jenkins job name under [RT] (default: JWST)',
default='JWST',
metavar='job-name',
)
parser.add_argument(
'--dry-run', action='store_true', help='pass the --dry-run flag to JFrog CLI'
)
Expand Down Expand Up @@ -103,31 +97,29 @@
raise RuntimeError(f'Unknown artifactory operation: {okify_op}')


def artifactory_get_breadcrumbs(build_number, job_name, suffix):
def artifactory_get_breadcrumbs(build_number, suffix):
"""Download specfiles or other breadcrumb from Artifactory associated with
a build number and return a list of their locations on the local file system

An example search would be:
An example search for build 586 would be:

jfrog rt search jwst-pipeline-results/*/*_okify.json --props='build.number=540;build.name=RT :: JWST'
jfrog rt search jwst-pipeline-results/*_GITHUB_CI_*-586/*_okify.json
"""
build_name = f'RT :: {job_name}'

# Retrieve all the okify specfiles for failed tests.
args = list(
['jfrog', 'rt', 'dl']
+ [f'{ARTIFACTORY_REPO}/*/*{suffix}']
+ [f'--props=build.number={build_number};build.name={build_name}']
+ [f"{ARTIFACTORY_REPO}/*_GITHUB_CI_*-{build_number}/*{suffix}"]
+ ['--flat']
)
subprocess.run(args, check=True, capture_output=True)

return sorted(glob(f'*{suffix}'))


def artifactory_get_build_artifacts(build_number, job_name):
specfiles = artifactory_get_breadcrumbs(build_number, job_name, SPECFILE_SUFFIX)
asdffiles = artifactory_get_breadcrumbs(build_number, job_name, RTDATA_SUFFIX)
def artifactory_get_build_artifacts(build_number):
specfiles = artifactory_get_breadcrumbs(build_number, SPECFILE_SUFFIX)
asdffiles = artifactory_get_breadcrumbs(build_number, RTDATA_SUFFIX)

Check warning on line 122 in jwst/scripts/okify_regtests.py

View check run for this annotation

Codecov / codecov/patch

jwst/scripts/okify_regtests.py#L121-L122

Added lines #L121 - L122 were not covered by tests

if len(specfiles) != len(asdffiles):
raise RuntimeError('Different number of _okify.json and _rtdata.asdf files')
Expand All @@ -153,14 +145,13 @@
args = parse_args()

build = args.build_number
name = args.job_name

# Create and chdir to a temporary directory to store specfiles
with tempfile.TemporaryDirectory() as tmp_path:
print(f'Downloading test logs to {tmp_path}')
with pushd(tmp_path):
# Retrieve all the okify specfiles for failed tests.
specfiles, asdffiles = artifactory_get_build_artifacts(build, name)
specfiles, asdffiles = artifactory_get_build_artifacts(build)

Check warning on line 154 in jwst/scripts/okify_regtests.py

View check run for this annotation

Codecov / codecov/patch

jwst/scripts/okify_regtests.py#L154

Added line #L154 was not covered by tests

number_failed_tests = len(specfiles)

Expand Down
Loading
0