This PR cuts GitHub Action build times from 14-15 minutes, down to just under 7 minutes. It does this by: - caching `grafana-plugins/node_modules` and `pip` dependencies based on their respective dependency files (eg. `requirements.txt` & `yarn.lock`). This step alone saves ~3 minutes. - get rid of the "build-engine-docker-image" and "backend-integration-tests" jobs in the old "Integration Tests" workflow. This was split out this way so that we could build the backend docker image once, upload the artifact, and then reuse it across the backend and e2e tests. We no longer need these backend integration tests because we are testing the same thing in the e2e tests. This saves ~45 seconds of having to upload the image artifact. - few improvements within the integration tests themselves: - move plugin configuration to the `globalSetup.ts`. This means that every test does not need to check if the plugin has been configured because it is done once before all the tests are run. - cache the plugin frontend build. If your commit doesn't change anything to `grafana-plugin/src` or `grafana-plugin/yarn.lock` it should be safe to reuse a previously built/cached version of the plugin frontend. This saves ~3 minutes - cache playwright binaries/dependencies. Only re-install them if the version of `@playwright/test` in `grafana-plugin/yarn.lock` changes. This saves ~3 minutes. **Other things to mention** Once we refactor the `GSelect` component to not call the `onChange` callback on every keyDown event (#1628), this should allow us to parallelize the integration tests, and cut the time required to execute the tests themselves in half
42 lines
1.4 KiB
Python
42 lines
1.4 KiB
Python
# flake8: noqa
|
|
|
|
from .base import *
|
|
|
|
SECRET_KEY = "u5/IIbuiJR3Y9FQMBActk+btReZ5oOxu+l8MIJQWLfVzESoan5REE6UNSYYEQdjBOcty9CDak2X"
|
|
|
|
MIRAGE_SECRET_KEY = "V9u7DqZ6SrZHP+SvBT19dbB85NZJGgllpwYQ77BSr9kZ6n8ggXMfGd4sCll1TDcAPEolbVD8YbF"
|
|
MIRAGE_CIPHER_IV = "X+VFcDqtxJ5bbU+V"
|
|
|
|
BASE_URL = "http://localhost"
|
|
|
|
if DATABASE_TYPE == DatabaseTypes.SQLITE3:
|
|
DATABASES["default"]["NAME"] = DATABASE_NAME or "oncall_ci.db"
|
|
else:
|
|
DATABASES["default"] |= {
|
|
"NAME": DATABASE_NAME or "oncall_local_dev",
|
|
"USER": DATABASE_USER or DATABASE_DEFAULTS[DATABASE_TYPE]["USER"],
|
|
"PASSWORD": DATABASE_PASSWORD or "local_dev_pwd",
|
|
"HOST": DATABASE_HOST or f"{DATABASE_TYPE}_test",
|
|
"PORT": DATABASE_PORT or DATABASE_DEFAULTS[DATABASE_TYPE]["PORT"],
|
|
}
|
|
|
|
if BROKER_TYPE == BrokerTypes.RABBITMQ:
|
|
CELERY_BROKER_URL = RABBITMQ_URI
|
|
elif BROKER_TYPE == BrokerTypes.REDIS:
|
|
CELERY_BROKER_URL = REDIS_URI
|
|
|
|
# use redis as cache and celery broker on CI tests
|
|
if BROKER_TYPE != BrokerTypes.REDIS:
|
|
CACHES = {
|
|
"default": {
|
|
"BACKEND": "django.core.cache.backends.locmem.LocMemCache",
|
|
}
|
|
}
|
|
|
|
# Dummy Telegram token (fake one)
|
|
TELEGRAM_TOKEN = "0000000000:XXXXXXXXXXXXXXXXXXXXXXXXXXXX-XXXXXX"
|
|
|
|
TWILIO_ACCOUNT_SID = "dummy_twilio_account_sid"
|
|
TWILIO_AUTH_TOKEN = "dummy_twilio_auth_token"
|
|
|
|
EXTRA_MESSAGING_BACKENDS = [("apps.base.tests.messaging_backend.TestOnlyBackend", 42)]
|