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

Remove imports from Input module to prevent circular dependency #326

Merged
merged 1 commit into from
Feb 22, 2024
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 acto/checker/checker_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from acto.checker.impl.health import HealthChecker
from acto.checker.impl.operator_log import OperatorLogChecker
from acto.common import flatten_dict
from acto.input import InputModel
from acto.input.input import InputModel
from acto.oracle_handle import OracleHandle
from acto.result import OracleResults
from acto.snapshot import Snapshot
Expand Down
2 changes: 1 addition & 1 deletion acto/checker/impl/consistency.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
invalid_input_message,
is_subfield,
)
from acto.input import InputModel
from acto.input.get_matched_schemas import find_matched_schema
from acto.input.input import InputModel
from acto.input.property_attribute import PropertyAttribute
from acto.k8s_util.k8sutil import canonicalize_quantity
from acto.result import ConsistencyOracleResult, InvalidInputResult
Expand Down
2 changes: 1 addition & 1 deletion acto/checker/impl/tests/test_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from acto.checker.impl.consistency import ConsistencyChecker
from acto.checker.impl.tests import load_snapshot
from acto.common import Diff, PropertyPath
from acto.input import DeterministicInputModel
from acto.input.input import DeterministicInputModel
from acto.result import (
ConsistencyOracleResult,
InvalidInputResult,
Expand Down
3 changes: 1 addition & 2 deletions acto/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
from acto.common import kubernetes_client, print_event
from acto.constant import CONST
from acto.deploy import Deploy
from acto.input import InputModel
from acto.input.input import DeterministicInputModel
from acto.input.input import DeterministicInputModel, InputModel
from acto.input.testcase import TestCase
from acto.input.testplan import TestGroup
from acto.input.value_with_schema import ValueWithSchema, attach_schema_to_value
Expand Down
2 changes: 0 additions & 2 deletions acto/input/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
from .input import DeterministicInputModel, InputModel
from .testcase import TestCase
2 changes: 1 addition & 1 deletion acto/reproduce.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

from acto import DEFAULT_KUBERNETES_VERSION
from acto.engine import Acto
from acto.input import TestCase
from acto.input.input import DeterministicInputModel
from acto.input.testcase import TestCase

Check warning on line 17 in acto/reproduce.py

View workflow job for this annotation

GitHub Actions / coverage-report

Missing coverage

Missing coverage on line 17
from acto.input.testplan import TestGroup
from acto.input.value_with_schema import ValueWithSchema
from acto.input.valuegenerator import extract_schema_with_value_generator
Expand Down
6 changes: 1 addition & 5 deletions acto/schema/object.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,8 @@ def __init__(self, path: list, schema: dict) -> None:
self.properties: dict[str, BaseSchema] = {}
self.additional_properties = None
self.required = []
logger = get_thread_logger(with_prefix=True)
if "properties" not in schema and "additionalProperties" not in schema:
logger.warning(
"Object schema %s does not have properties nor additionalProperties",
self.path,
)
return
if "properties" in schema:
for property_key, property_schema in schema["properties"].items():
self.properties[property_key] = extract_schema(
Expand Down
2 changes: 1 addition & 1 deletion acto/serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from deepdiff.helper import NotPresent

from acto.common import Diff, PropertyPath
from acto.input import TestCase
from acto.input.testcase import TestCase


def _serialize_decimal(value: decimal.Decimal):
Expand Down
3 changes: 2 additions & 1 deletion test/integration_tests/test_cassop_bugs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Integration tests for cass-operator bugs."""

import json
import os
import pathlib
Expand All @@ -8,7 +9,7 @@

from acto import acto_config
from acto.checker.checker_set import CheckerSet
from acto.input import DeterministicInputModel, InputModel
from acto.input.input import DeterministicInputModel, InputModel
from acto.lib.operator_config import OperatorConfig
from acto.post_process.post_diff_test import DiffTestResult, PostDiffTest
from acto.snapshot import Snapshot
Expand Down
3 changes: 2 additions & 1 deletion test/integration_tests/test_crdb_bugs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Integration tests for cockroach-operator bugs."""

import json
import os
import pathlib
Expand All @@ -8,7 +9,7 @@

from acto import acto_config
from acto.checker.checker_set import CheckerSet
from acto.input import DeterministicInputModel, InputModel
from acto.input.input import DeterministicInputModel, InputModel
from acto.lib.operator_config import OperatorConfig
from acto.snapshot import Snapshot

Expand Down
19 changes: 19 additions & 0 deletions test/integration_tests/test_data/elastic-on-k8s/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"deploy": {
"steps": [
{
"apply": {
"file": "test/integration_tests/test_data/elastic-on-k8s/crds.yaml"
}
},
{
"apply": {
"file": "test/integration_tests/test_data/elastic-on-k8s/operator.yaml",
"operator": true
}
}
]
},
"crd_name": "elasticsearches.elasticsearch.k8s.elastic.co",
"seed_custom_resource": "test/integration_tests/test_data/elastic-on-k8s/cr.yaml"
}
Loading
Loading