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

Assert that previously significant run stays significant #36

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
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
9 changes: 9 additions & 0 deletions runregistry_backend/cron/3.calculate_rr_attributes.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const assert = require('assert').strict;
const appendToAllAttributes = require('append-to-all-attributes');
const {
getComponentsIncludedBooleans,
Expand Down Expand Up @@ -61,6 +62,14 @@ exports.calculate_updated_rr_run_attributes = async (
oms_lumisections
);

// Make sure that if for some reason lumisections disappear
// and the run is no longer significant, we don't mess up the run information.
// TODO: This is probably not the best place to do this check
if (run_was_previously_significant) {
assert.deepStrictEqual(rr_run_attributes.significant && oms_lumisections.length !== 0, true,
`Run ${oms_run_attributes.run_number} would no longer be deemed significant`)
}

return rr_run_attributes;
};

Expand Down