-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4729 from grafana/dev
v1.8.6
- Loading branch information
Showing
88 changed files
with
1,437 additions
and
533 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
label = "OnCall.Backend" | ||
|
||
k8s_resource( | ||
workload="celery", | ||
resource_deps=["mariadb", "redis-master"], | ||
labels=[label], | ||
) | ||
|
||
k8s_resource( | ||
workload="engine", | ||
port_forwards=8080, | ||
resource_deps=["mariadb", "redis-master"], | ||
labels=[label], | ||
) | ||
|
||
k8s_resource(workload="engine-migrate", labels=[label]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
label = "OnCall.Deps" | ||
|
||
k8s_resource(workload="redis-master", labels=[label]) | ||
|
||
k8s_resource(workload="prometheus-server", labels=[label]) | ||
|
||
k8s_resource( | ||
workload="mariadb", | ||
port_forwards='3307:3306', # <host_port>:<container_port> | ||
labels=[label], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
label = "OnCall.Plugin" | ||
|
||
is_ci=config.tilt_subcommand == "ci" | ||
grafana_plugin_dir="../../grafana-plugin" | ||
|
||
# On CI dependencies are installed separately so we just build prod bundle to be consumed by Grafana dev server | ||
if is_ci: | ||
local_resource( | ||
"build-ui", | ||
labels=[label], | ||
dir=grafana_plugin_dir, | ||
cmd="yarn build", | ||
allow_parallel=True, | ||
) | ||
|
||
# Locally we install dependencies and we run watch mode | ||
if not is_ci: | ||
local_resource( | ||
"build-ui", | ||
labels=[label], | ||
dir=grafana_plugin_dir, | ||
cmd="yarn install", | ||
serve_dir=grafana_plugin_dir, | ||
serve_cmd="yarn watch", | ||
allow_parallel=True, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
label = "OnCall.AllTests" | ||
|
||
load('ext://uibutton', 'cmd_button', 'location', 'text_input', 'bool_input') | ||
|
||
e2e_tests_cmd=os.getenv("E2E_TESTS_CMD", "cd ../../grafana-plugin && yarn test:e2e") | ||
is_ci=config.tilt_subcommand == "ci" | ||
|
||
local_resource( | ||
"e2e-tests", | ||
labels=[label], | ||
cmd=e2e_tests_cmd, | ||
trigger_mode=TRIGGER_MODE_MANUAL, | ||
auto_init=is_ci, | ||
resource_deps=["build-ui", "grafana", "grafana-oncall-app-provisioning-configmap", "engine", "celery"] | ||
) | ||
|
||
cmd_button( | ||
name="E2E Tests - headless run", | ||
argv=["sh", "-c", "yarn --cwd ./grafana-plugin test:e2e $STOP_ON_FIRST_FAILURE $TESTS_FILTER"], | ||
text="Restart headless run", | ||
resource="e2e-tests", | ||
icon_name="replay", | ||
inputs=[ | ||
text_input("BROWSERS", "Browsers (e.g. \"chromium,firefox,webkit\")", "chromium", "chromium,firefox,webkit"), | ||
text_input("TESTS_FILTER", "Test filter (e.g. \"timezones.test quality.test\")", "", "Test file names to run"), | ||
bool_input("STOP_ON_FIRST_FAILURE", "Stop on first failure", True, "-x", ""), | ||
] | ||
) | ||
|
||
cmd_button( | ||
name="E2E Tests - open watch mode", | ||
argv=["sh", "-c", "yarn --cwd grafana-plugin test:e2e:watch"], | ||
text="Open watch mode", | ||
resource="e2e-tests", | ||
icon_name="visibility", | ||
) | ||
|
||
cmd_button( | ||
name="E2E Tests - show report", | ||
argv=["sh", "-c", "yarn --cwd grafana-plugin playwright show-report"], | ||
text="Show last HTML report", | ||
resource="e2e-tests", | ||
icon_name="assignment", | ||
) | ||
|
||
cmd_button( | ||
name="E2E Tests - stop current run", | ||
argv=["sh", "-c", "kill -9 $(pgrep -f test:e2e)"], | ||
text="Stop", | ||
resource="e2e-tests", | ||
icon_name="dangerous", | ||
) | ||
|
||
# Inspired by https://github.com/grafana/slo/blob/main/Tiltfile#L72 | ||
pod_engine_pytest_script = ''' | ||
set -eu | ||
# get engine k8s pod name from tilt resource name | ||
POD_NAME="$(tilt get kubernetesdiscovery "engine" -ojsonpath='{.status.pods[0].name}')" | ||
kubectl exec "$POD_NAME" -- pytest . $STOP_ON_FIRST_FAILURE $TESTS_FILTER | ||
''' | ||
local_resource( | ||
"pytest-tests", | ||
labels=[label], | ||
cmd=['sh', '-c', pod_engine_pytest_script], | ||
trigger_mode=TRIGGER_MODE_MANUAL, | ||
auto_init=False, | ||
resource_deps=["engine"] | ||
) | ||
|
||
cmd_button( | ||
name="pytest Tests - headless run", | ||
argv=['sh', '-c', pod_engine_pytest_script], | ||
text="Run pytest", | ||
resource="pytest-tests", | ||
icon_name="replay", | ||
inputs=[ | ||
text_input("TESTS_FILTER", "pytest optional arguments (e.g. \"apps/webhooks/tests/test_webhook.py::test_build_url_private_raises\")", "", "Test file names to run"), | ||
bool_input("STOP_ON_FIRST_FAILURE", "Stop on first failure", True, "-x", ""), | ||
] | ||
) |
Oops, something went wrong.