Skip to content
This repository has been archived by the owner on Feb 21, 2025. It is now read-only.

Commit

Permalink
Ooops!
Browse files Browse the repository at this point in the history
  • Loading branch information
nothingface0 committed Feb 19, 2025
1 parent de4f4c9 commit 4bb6021
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
19 changes: 10 additions & 9 deletions tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def get_valid_metadata(i: int = 0) -> dict:
VALID_METADATA = get_valid_metadata()


def fill_db(db: DQM2MirrorDB) -> None:
def fill_db(db: DQM2MirrorDB, extra: bool = False) -> None:
runs = []
graphs = []
runs_file = os.path.join(
Expand Down Expand Up @@ -153,11 +153,12 @@ def fill_db(db: DQM2MirrorDB) -> None:
except Exception as e:
print("Error when creating graph fixture:", e)
session.rollback()
# Add a comparison report
db.fill_cmssw_comparison_report(
**VALID_METADATA,
)
db.fill_cluster_status(CLUSTER_STATUS)
if extra:
# Add a comparison report
db.fill_cmssw_comparison_report(
**VALID_METADATA,
)
db.fill_cluster_status(CLUSTER_STATUS)


@pytest.fixture(scope="session")
Expand Down Expand Up @@ -193,7 +194,7 @@ def db_test_db():
db_name=db_name,
)

fill_db(db)
fill_db(db, extra=False)
yield db
drop_database(db_uri)

Expand Down Expand Up @@ -232,8 +233,8 @@ def server_test_dbs():
port=port,
db_name=DB_PLAY_NAME,
)
fill_db(db_prod)
fill_db(db_play)
fill_db(db_prod, extra=True)
fill_db(db_play, extra=True)
yield db_prod, db_play
drop_database(db_prod_uri)
drop_database(db_play_uri)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def test_fill_and_get(self, db_test_db: DQM2MirrorDB):


class TestDBCMSSWPR:
def test_db_cmssw_pr(db_test_db: DQM2MirrorDB):
def test_db_cmssw_pr(self, db_test_db: DQM2MirrorDB):
r = db_test_db.get_cmssw_pr(MAGIC_NUMBER)
assert not r
db_test_db.fill_cmssw_pr(MAGIC_NUMBER)
Expand Down

0 comments on commit 4bb6021

Please sign in to comment.