Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 2.0.0-internal-2
current_version = 2.1.0-internal-0
commit = False
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+)\-(?P<build>\d+))?
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.0-internal-2
2.1.0-internal-0
2 changes: 1 addition & 1 deletion dvp/src/main/python/dlpx/virtualization/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.0-internal-2
2.1.0-internal-0
2 changes: 1 addition & 1 deletion libs/src/main/python/dlpx/virtualization/libs/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.0-internal-2
2.1.0-internal-0
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.0-internal-2
2.1.0-internal-0
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.0-internal-2
2.1.0-internal-0
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ def prepare_upload_artifact(plugin_config_content, src_dir, schemas, manifest):
if plugin_config_content.get('externalVersion'):
artifact['externalVersion'] = plugin_config_content['externalVersion']

if plugin_config_content.get('luaName'):
artifact['luaName'] = plugin_config_content['luaName']

return artifact


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
"buildNumber": {
"type": "string",
"pattern": "^([0-9]+\\.)*[0-9]*[1-9][0-9]*(\\.[0-9]+)*$"
},
"luaName": {
"type": "string",
"pattern": "^[a-z0-9_:-]+$"
}
},
"additionalProperties": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
"buildNumber": {
"type": "string",
"pattern": "^([0-9]+\\.)*[0-9]*[1-9][0-9]*(\\.[0-9]+)*$"
},
"luaName": {
"type": "string",
"pattern": "^[a-z0-9_:-]+$"
}
},
"additionalProperties": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -651,3 +651,14 @@ def test_build_number_parameter(plugin_config_content, src_dir,
plugin_config_content, src_dir, schema_content, {})

assert expected == upload_artifact['buildNumber']

@staticmethod
@pytest.mark.parametrize('lua_name, expected', [
pytest.param('lua-toolkit-1', 'lua-toolkit-1'),
pytest.param(None, None)
])
def test_lua_name_parameter(plugin_config_content, src_dir,
schema_content, expected):
upload_artifact = build.prepare_upload_artifact(
plugin_config_content, src_dir, schema_content, {})
assert expected == upload_artifact.get('luaName')
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def artifact_file_created():
@pytest.fixture
def plugin_config_content(plugin_id, plugin_name, external_version, language,
host_types, plugin_type, entry_point, src_dir,
schema_file, manual_discovery, build_number):
schema_file, manual_discovery, build_number, lua_name):
"""
This fixutre creates the dict expected in the properties yaml file the
customer must provide for the build and compile commands.
Expand Down Expand Up @@ -216,6 +216,9 @@ def plugin_config_content(plugin_id, plugin_name, external_version, language,
if build_number:
config['buildNumber'] = build_number

if lua_name:
config['luaName'] = lua_name

return config


Expand Down Expand Up @@ -274,6 +277,11 @@ def build_number():
return '2.0.0'


@pytest.fixture
def lua_name():
return 'lua-toolkit-1'


@pytest.fixture
def artifact_manual_discovery():
return True
Expand Down Expand Up @@ -561,6 +569,7 @@ def basic_artifact_content(engine_api, virtual_source_definition,
'engineApi': engine_api,
'rootSquashEnabled': True,
'buildNumber': '2',
'luaName': 'lua-toolkit-1',
'sourceCode': 'UEsFBgAAAAAAAAAAAAAAAAAAAAAAAA==',
'manifest': {}
}
Expand Down Expand Up @@ -608,6 +617,7 @@ def artifact_content(engine_api, virtual_source_definition,
'sourceCode': 'UEsFBgAAAAAAAAAAAAAAAAAAAAAAAA==',
'rootSquashEnabled': True,
'buildNumber': '2',
'luaName': 'lua-toolkit-1',
'manifest': {}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class TestPackageUtil:
@staticmethod
def test_get_version():
assert package_util.get_version() == '2.0.0-internal-2'
assert package_util.get_version() == '2.1.0-internal-0'

@staticmethod
def test_get_virtualization_api_version():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,21 @@ def test_plugin_build_number_format(src_dir, plugin_config_file,
except exceptions.SchemaValidationError as err_info:
message = err_info.message
assert expected in message

@staticmethod
@mock.patch('os.path.isabs', return_value=False)
@pytest.mark.parametrize('lua_name, expected', [
('lua toolkit', "'lua toolkit' does not match"),
('!lua#toolkit', "'!lua#toolkit' does not match"),
(None, "should never get here")
])
def test_plugin_lua_name_format(src_dir, plugin_config_file,
plugin_config_content, expected):
try:
validator = PluginValidator.from_config_content(
plugin_config_file, plugin_config_content,
const.PLUGIN_CONFIG_SCHEMA)
validator.validate_plugin_config()
except exceptions.SchemaValidationError as err_info:
message = err_info.message
assert expected in message