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 .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
exclude: "node_modules|.git"
exclude: "(node_modules|\\.git|.*/test_.*)"
default_stages: [pre-commit]
fail_fast: false

Expand Down
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"trailingComma": "none"
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ frappe.ui.form.on("Agent Settings", {
frm.add_custom_button(__("Ping Control Plane"), () => {
frm.call("ping_controlplane");
});
},
}
});
2 changes: 1 addition & 1 deletion press_agent_manager/control_plane/doctype/agent/agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ frappe.ui.form.on("Agent", {
frm.add_custom_button("Ping", () => {
frm.call("ping");
});
},
}
});
17 changes: 14 additions & 3 deletions press_agent_manager/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,21 @@
# ---------------

scheduler_events = {
"daily_long": [
"press_agent_manager.workflow_engine.doctype.press_workflow_object.press_workflow_object.delete_trashed_objects",
],
"cron": {
"*/5 * * * *": "press_agent_manager.agent.control_plane.poll_queued_jobs",
"* * * * *": "press_agent_manager.agent.doctype.agent_job.agent_job.submit_agent_jobs_to_controlplane",
}
"*/5 * * * *": [
"press_agent_manager.agent.control_plane.poll_queued_jobs",
],
"* * * * */10": [
"press_agent_manager.workflow_engine.doctype.press_workflow.press_workflow.retry_workflows",
],
"* * * * *": [
"press_agent_manager.workflow_engine.doctype.press_workflow_task.press_workflow_task.retry_tasks",
"press_agent_manager.agent.doctype.agent_job.agent_job.submit_agent_jobs_to_controlplane",
],
},
}

fixtures = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@
# import frappe
from frappe.tests import IntegrationTestCase


# On IntegrationTestCase, the doctype test records and all
# link-field test record dependencies are recursively loaded
# Use these module variables to add/remove to/from that list
EXTRA_TEST_RECORD_DEPENDENCIES = [] # eg. ["User"]
IGNORE_TEST_RECORD_DEPENDENCIES = [] # eg. ["User"]



class IntegrationTestAnsiblePlay(IntegrationTestCase):
"""
Integration tests for AnsiblePlay.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@
# import frappe
from frappe.tests import IntegrationTestCase


# On IntegrationTestCase, the doctype test records and all
# link-field test record dependencies are recursively loaded
# Use these module variables to add/remove to/from that list
EXTRA_TEST_RECORD_DEPENDENCIES = [] # eg. ["User"]
IGNORE_TEST_RECORD_DEPENDENCIES = [] # eg. ["User"]



class IntegrationTestAnsibleTask(IntegrationTestCase):
"""
Integration tests for AnsibleTask.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@
# import frappe
from frappe.tests import IntegrationTestCase


# On IntegrationTestCase, the doctype test records and all
# link-field test record dependencies are recursively loaded
# Use these module variables to add/remove to/from that list
EXTRA_TEST_RECORD_DEPENDENCIES = [] # eg. ["User"]
IGNORE_TEST_RECORD_DEPENDENCIES = [] # eg. ["User"]



class IntegrationTestVirtualMachine(IntegrationTestCase):
"""
Integration tests for VirtualMachine.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ frappe.ui.form.on("Virtual Machine", {
`Are you sure you want to ${label.toLowerCase()} this virtual machine?`,
() => {
frm.call(method).then(() => frm.refresh());
},
}
);
},
"Actions",
"Actions"
);
});
},
}
});
1 change: 1 addition & 0 deletions press_agent_manager/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ Press Agent Manager
Control Plane
Agent
Infrastructure
Workflow Engine
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@
# import frappe
from frappe.tests import IntegrationTestCase


# On IntegrationTestCase, the doctype test records and all
# link-field test record dependencies are recursively loaded
# Use these module variables to add/remove to/from that list
EXTRA_TEST_RECORD_DEPENDENCIES = [] # eg. ["User"]
IGNORE_TEST_RECORD_DEPENDENCIES = [] # eg. ["User"]



class IntegrationTestGaplessSeries(IntegrationTestCase):
"""
Integration tests for GaplessSeries.
Expand Down
4 changes: 2 additions & 2 deletions press_agent_manager/press_agent_manager/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def _execute_command_impl(*popenargs: Any, **kwargs: Any):
if user_env:
base_env.update(user_env)

if isinstance(cmd, (list, tuple)) and list(cmd[:2]) == ["chroot", rootfs]:
if isinstance(cmd, list | tuple) and list(cmd[:2]) == ["chroot", rootfs]:
return subprocess.run(*popenargs, **kwargs)

prefix = ["chroot", rootfs, "/usr/bin/env", "-i"]
Expand All @@ -98,7 +98,7 @@ def _execute_command_impl(*popenargs: Any, **kwargs: Any):
else:
if isinstance(cmd, str):
cmd = shlex.split(cmd)
new_cmd = [*prefix, *cmd] if isinstance(cmd, (list, tuple)) else cmd
new_cmd = [*prefix, *cmd] if isinstance(cmd, list | tuple) else cmd

if use_kwargs:
kwargs["args"] = new_cmd
Expand Down
Loading
Loading