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

Try re-adding CLI tests on Github Actions #778

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
14 changes: 7 additions & 7 deletions flexmeasures/cli/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def setup_dummy_asset(fresh_db, app):

dummy_asset_type = GenericAssetType(name="DummyGenericAssetType")

db.session.add(dummy_asset_type)
fresh_db.session.add(dummy_asset_type)

dummy_asset = GenericAsset(
name="DummyGenericAsset", generic_asset_type=dummy_asset_type
Expand Down Expand Up @@ -48,25 +48,25 @@ def setup_dummy_data(fresh_db, app, setup_dummy_asset):
name="PandasReport", generic_asset_type=report_asset_type
)

db.session.add(pandas_report)
fresh_db.session.add(pandas_report)

dummy_asset = GenericAsset.query.get(setup_dummy_asset)

sensor1 = Sensor(
"sensor 1", generic_asset=dummy_asset, event_resolution=timedelta(hours=1)
)

db.session.add(sensor1)
fresh_db.session.add(sensor1)
sensor2 = Sensor(
"sensor 2", generic_asset=dummy_asset, event_resolution=timedelta(hours=1)
)
db.session.add(sensor2)
fresh_db.session.add(sensor2)
report_sensor = Sensor(
"report sensor",
generic_asset=pandas_report,
event_resolution=timedelta(hours=2),
)
db.session.add(report_sensor)
fresh_db.session.add(report_sensor)

report_sensor_2 = Sensor(
"report sensor 2",
Expand All @@ -92,8 +92,8 @@ def setup_dummy_data(fresh_db, app, setup_dummy_asset):
)
)

db.session.add_all(beliefs)
db.session.commit()
fresh_db.session.add_all(beliefs)
fresh_db.session.commit()

yield sensor1.id, sensor2.id, report_sensor.id, report_sensor_2.id

Expand Down
4 changes: 2 additions & 2 deletions flexmeasures/cli/tests/test_data_add.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


@pytest.mark.skip_github
def test_add_annotation(app, db, setup_roles_users):
def test_add_annotation(app, setup_roles_users_fresh_db):
from flexmeasures.cli.data_add import add_annotation

cli_input = {
Expand Down Expand Up @@ -54,7 +54,7 @@ def test_add_annotation(app, db, setup_roles_users):


@pytest.mark.skip_github
def test_add_holidays(app, db, setup_roles_users):
def test_add_holidays(app, setup_roles_users_fresh_db):
from flexmeasures.cli.data_add import add_holidays

cli_input = {
Expand Down
Loading