Rename PushToBranchAction to PushHeadToMasterAction
This rename better reflects the currently hardcoded behavior of the
class.
Change-Id: Ib90855fef422aed2928de92e23d6cbcb68124d5f
diff --git a/README.md b/README.md
index 99f2dcf..343bb2c 100644
--- a/README.md
+++ b/README.md
@@ -70,16 +70,16 @@
The following actions can be performed by the tests:
-| key | description |
-|-------------------|------------------------------------------------------------------------------------------|
-| `clone_project` | Test performs a clone of a project, that is assigned to the simulated user |
-| `create_project` | Test creates a new project via REST |
-| `fetch_project` | Test fetches a project, that is assigned to the simulated user and was already cloned |
-| `push_for_review` | Test creates random commits in a cloned project and pushes them to `refs/for/master` |
-| `push_to_branch` | Test creates random commits in a cloned project and pushes them to the remote's `master` |
-| `query_changes` | Queries changes via REST |
-| `query_projects` | Queries projects via REST |
-| `review_change` | Reviews a change via REST |
+| key | description |
+|-----------------------|------------------------------------------------------------------------------------------|
+| `clone_project` | Test performs a clone of a project, that is assigned to the simulated user |
+| `create_project` | Test creates a new project via REST |
+| `fetch_project` | Test fetches a project, that is assigned to the simulated user and was already cloned |
+| `push_for_review` | Test creates random commits in a cloned project and pushes them to `refs/for/master` |
+| `push_head_to_master` | Test creates random commits in a cloned project and pushes them to the remote's `master` |
+| `query_changes` | Queries changes via REST |
+| `query_projects` | Queries projects via REST |
+| `review_change` | Reviews a change via REST |
## Run
diff --git a/config.sample.yaml b/config.sample.yaml
index a931db1..e99d1a5 100644
--- a/config.sample.yaml
+++ b/config.sample.yaml
@@ -24,7 +24,7 @@
probability: 1
push_for_review:
probability: 1
- push_to_branch:
+ push_head_to_master:
probability: 1
query_changes:
probability: 1
diff --git a/container/tools/actions/__init__.py b/container/tools/actions/__init__.py
index 7f691f0..77f9b81 100644
--- a/container/tools/actions/__init__.py
+++ b/container/tools/actions/__init__.py
@@ -16,7 +16,7 @@
from .create_project import CreateProjectAction
from .fetch_project import FetchProjectAction
from .push_for_review import PushForReviewAction
-from .push_to_branch import PushToBranchAction
+from .push_head_to_master import PushHeadToMasterAction
from .query_change_files import QueryChangeFilesAction
from .query_changes import QueryChangesAction
from .query_projects import QueryProjectsAction
diff --git a/container/tools/actions/push_to_branch.py b/container/tools/actions/push_head_to_master.py
similarity index 93%
rename from container/tools/actions/push_to_branch.py
rename to container/tools/actions/push_head_to_master.py
index 996bc46..11d560c 100644
--- a/container/tools/actions/push_to_branch.py
+++ b/container/tools/actions/push_head_to_master.py
@@ -16,7 +16,7 @@
from .fetch_project import FetchProjectAction
-class PushToBranchAction(abstract_push.AbstractPushAction):
+class PushHeadToMasterAction(abstract_push.AbstractPushAction):
def __init__(self, project_name, probability=1):
super().__init__("HEAD:master", project_name, probability=probability)
diff --git a/container/tools/config/parser.py b/container/tools/config/parser.py
index 9eb1d6d..f06c27b 100644
--- a/container/tools/config/parser.py
+++ b/container/tools/config/parser.py
@@ -33,7 +33,7 @@
"create_project": {"probability": 1},
"fetch_project": {"probability": 1},
"push_for_review": {"probability": 1},
- "push_to_branch": {"probability": 1},
+ "push_head_to_master": {"probability": 1},
"query_changes": {"probability": 1},
"query_projects": {"probability": 1},
"review_change": {"probability": 1},
diff --git a/container/tools/start_test.py b/container/tools/start_test.py
index 37b8210..3cf2cb0 100755
--- a/container/tools/start_test.py
+++ b/container/tools/start_test.py
@@ -78,7 +78,7 @@
if self.cloned_projects:
self._exec_fetch_project_action()
- self._exec_push_commit_action()
+ self._exec_push_head_to_master_action()
self._exec_push_change_action()
self._exec_query_changes_action()
@@ -144,10 +144,10 @@
)
action.execute()
- def _exec_push_commit_action(self):
- action = actions.PushToBranchAction(
+ def _exec_push_head_to_master_action(self):
+ action = actions.PushHeadToMasterAction(
self._choose_from_list_poisson(list(self.cloned_projects)),
- self.action_config["push_to_branch"]["probability"],
+ self.action_config["push_head_to_master"]["probability"],
)
action.execute()
diff --git a/kubernetes/load-tester/load-tester.configmap.yaml b/kubernetes/load-tester/load-tester.configmap.yaml
index 736bb29..f301195 100644
--- a/kubernetes/load-tester/load-tester.configmap.yaml
+++ b/kubernetes/load-tester/load-tester.configmap.yaml
@@ -27,7 +27,7 @@
probability: 1
push_for_review:
probability: 1
- push_to_branch:
+ push_head_to_master:
probability: 1
query_changes:
probability: 1