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

Fix bugs in resource specification queries. #366

Merged

Conversation

aaronweeden
Copy link
Contributor

@aaronweeden aaronweeden commented Dec 4, 2023

Description

This PR fixes two queries related to resource specifications:

  1. A query used to generate the resource list for the /rest/supremm_dataflow/quality endpoint.
  2. A query used for grouping by resource.

Motivation and Context

Both of these bugs were exposed by the automated tests after ubccr/xdmod#1786 was merged.

  1. The first query previously took the resource specification end dates as Unix timestamps and compared them with date values in %Y-%m-d format. This led to empty lists of resources. The empty list was not properly handled, and the query generated a SQL error. This PR fixes both the handling of empty lists and the date comparison. Automated tests did not catch this bug previously because end dates were not set for the example resources until Add resource specs realm ingestion aggregation xdmod#1786; the end dates had instead been coalesced to a valid default value.
  2. The second query used the column name processors, which was changed to cpu_processor_count in Add resource specs realm ingestion aggregation xdmod#1786.

Tests performed

  1. For the first query, I manually tested in a Docker container running tools-ext-01.ccr.xdmod.org/xdmod-job_performance-10.5.0:rockylinux8-0.1. As I made changes, I did manual GET requests to the endpoint:

    /rest/supremm_dataflow/quality?start=2022-05-01&end=2022-05-08
    

    with the type parameter set to hardware, cpu, and realms.

    I also modified the integration tests to test for empty resource lists.

  2. The second query is covered by the existing UI tests.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project as found in the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@aaronweeden aaronweeden added the bug label Dec 4, 2023
@aaronweeden aaronweeden added this to the 11.0.0 milestone Dec 4, 2023
@aaronweeden aaronweeden marked this pull request as draft December 4, 2023 20:41
@aaronweeden aaronweeden changed the title Fix resource list query for dataflow quality endpoint. Fix bugs in resource specification queries. Dec 5, 2023
@aaronweeden aaronweeden merged commit 7d6d5c6 into ubccr:xdmod11.0 Dec 5, 2023
3 checks passed
@aaronweeden aaronweeden deleted the fix-dataflow-quality-reslist branch December 5, 2023 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants