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 mock mechanism #4764

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
8d7257c
remove mock mechanism
MosheEichler Jan 12, 2025
ca0b8ef
Merge branch 'refs/heads/master' into remove-mockable-mechanism
MosheEichler Jan 30, 2025
49073f9
merge msater
MosheEichler Feb 3, 2025
c3b8a62
remove unmockable integration from conf.json
MosheEichler Feb 3, 2025
caa3ae0
update conf json
MosheEichler Feb 4, 2025
7127990
Merge branch 'refs/heads/master' into remove-mockable-mechanism
MosheEichler Feb 4, 2025
eedb675
remove redundant un-mockable
MosheEichler Feb 4, 2025
5748692
remove more redundant code
MosheEichler Feb 5, 2025
95972c3
remove timestamp replacer
MosheEichler Feb 5, 2025
3a11677
pre-commit fixes
MosheEichler Feb 5, 2025
f0acf2a
Merge branch 'refs/heads/master' into remove-mockable-mechanism
MosheEichler Feb 5, 2025
cfb0cfd
add changelog
MosheEichler Feb 5, 2025
d3c40b9
fix UTs
MosheEichler Feb 6, 2025
23ad0aa
remove isAMI
MosheEichler Feb 6, 2025
72b1111
ruff fixes
MosheEichler Feb 6, 2025
7ccc81c
fixes
MosheEichler Feb 6, 2025
a259872
fixed more UT
MosheEichler Feb 7, 2025
031c05b
fixed all UT
MosheEichler Feb 8, 2025
b2f452e
add a debug message
MosheEichler Feb 9, 2025
80d2e35
ruff fixes
MosheEichler Feb 9, 2025
3583f72
mypy error
MosheEichler Feb 9, 2025
e9f10c0
fix print error
MosheEichler Feb 9, 2025
5b6c859
update version message
MosheEichler Feb 9, 2025
0ac5319
add logs
MosheEichler Feb 9, 2025
b87a8dc
Merge branch 'master' into remove-mockable-mechanism
MosheEichler Feb 9, 2025
1888b05
remove natured code
MosheEichler Feb 10, 2025
5825793
Merge branch 'refs/heads/master' into remove-mockable-mechanism
MosheEichler Feb 10, 2025
9d11d13
Merge branch 'master' into remove-mockable-mechanism
MosheEichler Feb 10, 2025
af4f9dc
remove redundant log
MosheEichler Feb 10, 2025
2c659e7
Merge branch 'refs/heads/master' into remove-mockable-mechanism
MosheEichler Feb 10, 2025
053d742
empty-commit
MosheEichler Feb 10, 2025
f29692b
CR fixes
MosheEichler Feb 17, 2025
4dd39a2
Merge branch 'master' into remove-mockable-mechanism
MosheEichler Feb 17, 2025
4edf4bc
CR fixes
MosheEichler Feb 19, 2025
7f7edd9
Merge branch 'refs/heads/master' into remove-mockable-mechanism
MosheEichler Feb 19, 2025
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
4 changes: 4 additions & 0 deletions .changelog/4764.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
changes:
- description: Removed mocking mechanism in test-content command.
type: breaking
pr_number: 4764
4 changes: 0 additions & 4 deletions TestSuite/conf_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ def write_json(
tests: Optional[List[dict]] = None,
skipped_tests: Optional[Dict[str, str]] = None,
skipped_integrations: Optional[Dict[str, str]] = None,
unmockable_integrations: Optional[List[str]] = None,
docker_thresholds: Optional[dict] = None,
):
if tests is None:
Expand All @@ -28,8 +27,6 @@ def write_json(
skipped_tests = {}
if skipped_integrations is None:
skipped_integrations = {}
if unmockable_integrations is None:
unmockable_integrations = []
if docker_thresholds is None:
docker_thresholds = {"_comment": "", "images": []}
self._file_path.write_text(
Expand All @@ -38,7 +35,6 @@ def write_json(
"tests": tests,
"skipped_tests": skipped_tests,
"skipped_integrations": skipped_integrations,
"unmockable_integrations": unmockable_integrations,
"docker_thresholds": docker_thresholds,
# the next fields are not modified in tests (hence lack of args), but are structurally required.
"available_tests_fields": [],
Expand Down
6 changes: 0 additions & 6 deletions demisto_sdk/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,12 +411,6 @@ def register_commands(_args: list[str] = []): # noqa: C901
)(error_code)

if command_name == "test-content" or register_all:
message = typer.style(
"Warning: The mocking mechanism will be removed in the next release of the Demisto SDK.",
fg=typer.colors.RED,
)
typer.echo(message)

from demisto_sdk.commands.test_content.content_test_setup import test_content

app.command(
Expand Down
2 changes: 1 addition & 1 deletion demisto_sdk/commands/common/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -1335,7 +1335,7 @@ class PB_Status:
IN_PROGRESS = "inprogress"
FAILED_DOCKER_TEST = "failed_docker_test"
CONFIGURATION_FAILED = "failed_configuration"
SECOND_PLAYBACK_REQUIRED = "second_playback_required"
SECOND_RUN_REQUIRED = "second_run_required"


# change log regexes
Expand Down
4 changes: 1 addition & 3 deletions demisto_sdk/commands/common/hook_validations/conf_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,13 @@ def load_conf_file(self):
return json.load(data_file)

def is_valid_conf_json(self):
"""Validate the fields skipped_tests, skipped_integrations and unmockable_integrations in conf.json file."""
"""Validate the fields skipped_tests and skipped_integrations in conf.json file."""
logger.info("\nValidating conf.json")
skipped_tests_conf = self.conf_data["skipped_tests"]
skipped_integrations_conf = self.conf_data["skipped_integrations"]
unmockable_integrations_conf = self.conf_data["unmockable_integrations"]

self.is_valid_description_in_conf_dict(skipped_tests_conf)
self.is_valid_description_in_conf_dict(skipped_integrations_conf)
self.is_valid_description_in_conf_dict(unmockable_integrations_conf)

return self._is_valid

Expand Down
3 changes: 0 additions & 3 deletions demisto_sdk/commands/content_graph/objects/conf_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class Test(StrictBaseModel):
integrations: Optional[Union[str, List[str]]] = None
instance_names: Optional[Union[str, List[str]]] = None
timeout: Optional[int] = None
is_mockable: Optional[bool] = None
memory_threshold: Optional[int] = None
pid_threshold: Optional[int] = None
has_api: Optional[bool] = None
Expand Down Expand Up @@ -80,7 +79,6 @@ class ConfJSON(StrictBaseModel):
skipped_integrations: Dict[str, str]
native_nightly_packs: Optional[List[str]]
nightly_packs: List[str]
unmockable_integrations: Dict[str, str]
parallel_integrations: List[str]
private_tests: List[str]
docker_thresholds: DockerThresholds
Expand All @@ -102,7 +100,6 @@ def linked_content_items(self) -> Dict[ContentType, Set[str]]:
itertools.chain.from_iterable(
always_iterable(test.integrations) for test in self.tests
),
self.unmockable_integrations.keys(),
self.parallel_integrations,
(
v
Expand Down
Loading