Commit 12a3ff65 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI

Merge branch '275_fix_algorithm_migration' into 'master'

Fix algorithm migration handling

Closes #275

See merge request !143
parents 78c47654 c5f2970b
Pipeline #41806 passed with stages
in 13 minutes and 3 seconds
......@@ -105,7 +105,7 @@ class TestHelperMethods:
assert v1_declaration != v2_declaration
assert v2_declaration["schema_version"] == 2
assert v2_declaration["api_version"] == 2
assert v2_declaration["type"] == "legacy"
assert v2_declaration["type"] == "sequential"
@pytest.mark.parametrize(
["algorithm_name", "new_type", "field_to_add"],
......
......@@ -23,6 +23,7 @@
# #
###############################################################################
import json
import os
import random
......@@ -591,6 +592,10 @@ class TestAssetWidget:
asset_widget.loadAsset(asset)
assert asset_widget.current_asset.name == "v1/sum/2"
assert (
json.loads(asset_widget.json_widget.toPlainText())
== asset_widget.current_asset.declaration
)
def test_experiment_error_hinting(self, qtbot, test_prefix, beat_context):
asset_widget = AssetWidget()
......
......@@ -96,7 +96,7 @@ def migrate_to_api_v2(asset):
declaration = new_asset.declaration
declaration["api_version"] = 2
declaration["schema_version"] = 2
declaration["type"] = "legacy"
declaration["type"] = "sequential"
new_asset.declaration = declaration
return status, new_asset
......
......@@ -492,6 +492,7 @@ class AssetWidget(QWidget):
status, asset = migrate_to_api_v2(asset)
if status:
update_code(asset)
declaration = asset.declaration
else:
QMessageBox.information(
self,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment