Fix bugs in resource specification queries. #366
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes two queries related to resource specifications:
/rest/supremm_dataflow/quality
endpoint.Motivation and Context
Both of these bugs were exposed by the automated tests after ubccr/xdmod#1786 was merged.
%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.processors
, which was changed tocpu_processor_count
in Add resource specs realm ingestion aggregation xdmod#1786.Tests performed
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:with the
type
parameter set tohardware
,cpu
, andrealms
.I also modified the integration tests to test for empty resource lists.
The second query is covered by the existing UI tests.
Types of changes
Checklist: