Skip to content

Enabled to specify redis_proc_start_port on self contained coordinator; Include merge-base commit tests on API trigger #106

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

Merged
merged 4 commits into from
May 16, 2022
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
114 changes: 9 additions & 105 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ argparse = "^1.4.0"
Flask-HTTPAuth = "^4.4.0"
PyYAML = "^5.4.1"
docker = "^5.0.0"
redisbench-admin = "^0.8.6"
redisbench-admin = "^0.9.3"
#redisbench-admin = {path = "../redisbench-admin", develop = true}
psutil = "^5.8.0"
tox-docker = "^3.1.0"
Expand Down
40 changes: 36 additions & 4 deletions redis_benchmarks_specification/__api__/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@
SIG_HEADER = "X-Hub-Signature"


def should_action(action):
res = False
types = ["synchronize", "opened", "reopened", "labeled"]
for tt in types:
if action in tt:
res = True
return res


def create_app(conn, user, test_config=None):
app = Flask(__name__)

Expand Down Expand Up @@ -63,7 +72,7 @@ def base():
trigger_label = PULL_REQUEST_TRIGGER_LABEL
if "pull_request" in request_data:
action = request_data["action"]
if "labeled" == action:
if should_action(action):
pull_request_dict = request_data["pull_request"]
head_dict = pull_request_dict["head"]
repo_dict = head_dict["repo"]
Expand Down Expand Up @@ -93,6 +102,7 @@ def base():
)

# Git pushes to repo
before_sha = None
if "ref" in request_data:
repo_dict = request_data["repository"]
html_url = repo_dict["html_url"].split("/")
Expand All @@ -101,11 +111,33 @@ def base():
ref = request_data["ref"].split("/")[-1]
ref_label = request_data["ref"]
sha = request_data["after"]
before_sha = request_data["before"]
use_event = True
event_type = "Git pushes to repo"

if use_event is True:
fields = {
if before_sha is not None:
fields_before = {
"git_hash": sha,
"ref_label": ref_label,
"ref": ref,
"gh_repo": gh_repo,
"gh_org": gh_org,
}
app.logger.info(
"Using event {} to trigger merge-base commit benchmark. final fields: {}".format(
event_type, fields_before
)
)
result, response_data, err_message = commit_schema_to_stream(
fields_before, conn, gh_org, gh_repo
)
app.logger.info(
"Using event {} to trigger merge-base commit benchmark. final fields: {}".format(
event_type, response_data
)
)
fields_after = {
"git_hash": sha,
"ref_label": ref_label,
"ref": ref,
Expand All @@ -114,11 +146,11 @@ def base():
}
app.logger.info(
"Using event {} to trigger benchmark. final fields: {}".format(
event_type, fields
event_type, fields_after
)
)
result, response_data, err_message = commit_schema_to_stream(
fields, conn, gh_org, gh_repo
fields_after, conn, gh_org, gh_repo
)
app.logger.info(
"Using event {} to trigger benchmark. final fields: {}".format(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def create_self_contained_coordinator_args(project_name):
default=MACHINE_CPU_COUNT,
help="Specify how much of the available CPU resources the coordinator can use.",
)
parser.add_argument("--redis_proc_start_port", type=int, default=6379)
parser.add_argument("--cpuset_start_pos", type=int, default=0)
parser.add_argument(
"--platform-name",
Expand Down
Loading