Skip to content

Commit

Permalink
Output Validator - 359 - Fix issue where schema.py files from the ven…
Browse files Browse the repository at this point in the history
…v folder were being validated (#179)
  • Loading branch information
igorski-r7 authored Feb 7, 2024
1 parent 49fdcde commit cc88caf
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ be on your way to contributing!

## Changelog

* 2.47.14 - `OutputValidator` - Fix issue where `schema.py` files from the venv folder were being validated
* 2.47.13 - `HelpInputOutputValidator` - Fix validator to change single quotes to double quotes when an input field uses list values so that it does not break
* 2.47.12 - `VersionBumpValidator` - update validation for connection versions| Updated `GitPython` to version 3.1.41.
* 2.47.11 - Update PyYaml version to fix unrelated tooling installation bug.
Expand Down
2 changes: 1 addition & 1 deletion icon_validator/rules/plugin_validators/output_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def get_schemas(spec):
sys.path.append(spec.directory)
for path, _, files in os.walk(spec.directory):
for file in files:
if "schema.py" in file and os.path.basename(path) != "connection":
if "schema.py" in file and os.path.basename(path) != "connection" and "lib/python" not in path:
full_path = os.path.join(path, file)
schemas[os.path.basename(path)] = OutputValidator.read_schema(full_path)
return schemas
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name="insightconnect_integrations_validators",
version="2.47.13",
version="2.47.14",
description="Validator tooling for InsightConnect integrations",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def test() -> None:
pass
8 changes: 8 additions & 0 deletions unit_test/test_validate_plugin/test_validate_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from icon_validator.rules.plugin_validators.supported_version_validator import SupportedVersionValidator
from icon_validator.rules.plugin_validators.help_input_output_validator import convert_to_valid_datetime
from icon_validator.rules.plugin_validators.name_validator import NameValidator
from icon_validator.rules.plugin_validators.output_validator import OutputValidator

import requests
from unittest.mock import MagicMock, patch
Expand All @@ -35,6 +36,7 @@
class TestPluginValidate(unittest.TestCase):

NAME_TESTS_DIRECTORY = "plugin_examples/name_tests"
GOOD_PLUGIN_DIRECTORY = "plugin_examples/good_plugin"

@parameterized.expand([
('2023-12-24 12:56:15+05:00', '2023-12-24T12:56:15+05:00'),
Expand Down Expand Up @@ -768,6 +770,12 @@ def test_good_name_validator(self):
result = validate(directory_to_test, file_to_test, False, True, [NameValidator()])
self.assertEqual(result, 0)

def test_schema_output_validator(self) -> None:
directory_to_test = self.GOOD_PLUGIN_DIRECTORY
file_to_test = "plugin.spec.yaml"
result = validate(directory_to_test, file_to_test, False, True, [OutputValidator()])
self.assertEqual(result, 0)

@staticmethod
def replace_requirements(path, text):
f = open(path, 'w')
Expand Down

0 comments on commit cc88caf

Please sign in to comment.