Skip to content

Unit tests encounter errors when retrieving metrics, but overall tests still pass. #32

Description

@alexskr

Unit tests encounter errors when retrieving metrics, but they still pass, which raises questions about the validity of those tests.

TestRecommender#test_recommend = E, [2024-07-04T00:18:44.738241 #8] ERROR -- : Unable to retrieve metrics for latest submission of http://data.bioontology.org/ontologies/BROTEST-0 in Recommender.
E, [2024-07-04T00:18:44.776653 #8] ERROR -- : Unable to retrieve metrics for latest submission of http://data.bioontology.org/ontologies/ONTOMATEST-0 in Recommender.
E, [2024-07-04T00:18:44.815828 #8] ERROR -- : Unable to retrieve metrics for latest submission of http://data.bioontology.org/ontologies/MCCLTEST-0 in Recommender.
0.15 s = .
TestRecommender#test_recommend_with_classes = E, [2024-07-04T00:18:44.884464 #8] ERROR -- : Unable to retrieve metrics for latest submission of http://data.bioontology.org/ontologies/BROTEST-0 in Recommender.
E, [2024-07-04T00:18:44.923456 #8] ERROR -- : Unable to retrieve metrics for latest submission of http://data.bioontology.org/ontologies/ONTOMATEST-0 in Recommender.
E, [2024-07-04T00:18:44.961876 #8] ERROR -- : Unable to retrieve metrics for latest submission of http://data.bioontology.org/ontologies/MCCLTEST-0 in Recommender.
0.15 s = .
TestRecommender#test_recommend_with_ontologies = E, [2024-07-04T00:18:45.029686 #8] ERROR -- : Unable to retrieve metrics for latest submission of http://data.bioontology.org/ontologies/BROTEST-0 in Recommender.
E, [2024-07-04T00:18:45.068835 #8] ERROR -- : Unable to retrieve metrics for latest submission of http://data.bioontology.org/ontologies/MCCLTEST-0 in Recommender.
0.11 s = .

Finished tests in 24.179108s, 0.6204 tests/s, 535.8758 assertions/s.

15 tests, 12957 assertions, 0 failures, 0 errors, 1 skips

I think its because we are rescuing error here

begin
sub.bring(metrics: LinkedData::Models::Metric.attributes)
cls_count = sub.metrics.classes
rescue
@logger.error("Unable to retrieve metrics for latest submission of #{ont.id.to_s} in Recommender.")
cls_count = LinkedData::Models::Class.where.in(sub).count
end
return cls_count || 0
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions