Skip to content

Commit 4181e25

Browse files
committed
test: add tests for reusable workflows
Refs: RATY-350
1 parent 9999c44 commit 4181e25

26 files changed

Lines changed: 638 additions & 0 deletions

.github/dependabot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,19 @@ updates:
1212
default-days: 7
1313
commit-message:
1414
prefix: "deps"
15+
16+
# Fixture package files in .github/workflow-fixtures/ are intentionally
17+
# pinned and excluded from automated updates.
18+
- package-ecosystem: "pip"
19+
directory: "/.github/workflow-fixtures"
20+
schedule:
21+
interval: "weekly"
22+
ignore:
23+
- dependency-name: "*"
24+
25+
- package-ecosystem: "npm"
26+
directory: "/.github/workflow-fixtures"
27+
schedule:
28+
interval: "weekly"
29+
ignore:
30+
- dependency-name: "*"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// No rules enforced — any commit message is accepted.
2+
// This config exists so that workflows using wagoid/commitlint-github-action
3+
// do not fail with "no config found" when called from this repository.
4+
export default {
5+
rules: {},
6+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
repos: []
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import os
2+
from pathlib import Path
3+
4+
BASE_DIR = Path(__file__).resolve().parent.parent
5+
6+
SECRET_KEY = os.environ.get("SECRET_KEY", "compat-secret")
7+
DEBUG = True
8+
ALLOWED_HOSTS: list[str] = ["*"]
9+
10+
INSTALLED_APPS = [
11+
"django.contrib.auth",
12+
"django.contrib.contenttypes",
13+
"django.contrib.sessions",
14+
"django.contrib.messages",
15+
"django.contrib.staticfiles",
16+
]
17+
18+
MIDDLEWARE = [
19+
"django.middleware.security.SecurityMiddleware",
20+
"django.contrib.sessions.middleware.SessionMiddleware",
21+
"django.middleware.common.CommonMiddleware",
22+
"django.middleware.csrf.CsrfViewMiddleware",
23+
"django.contrib.auth.middleware.AuthenticationMiddleware",
24+
"django.contrib.messages.middleware.MessageMiddleware",
25+
]
26+
27+
ROOT_URLCONF = "config.urls"
28+
TEMPLATES: list[dict[str, object]] = []
29+
WSGI_APPLICATION = "config.wsgi.application"
30+
31+
DATABASES = {
32+
"default": {
33+
"ENGINE": "django.db.backends.postgresql",
34+
"NAME": os.environ.get("POSTGRES_DB", "test_db"),
35+
"USER": os.environ.get("POSTGRES_USER", "test_user"),
36+
"PASSWORD": os.environ.get("POSTGRES_PASSWORD", "test_password"),
37+
"HOST": os.environ.get("POSTGRES_HOST", "localhost"),
38+
"PORT": os.environ.get("POSTGRES_PORT", "5432"),
39+
}
40+
}
41+
42+
LANGUAGE_CODE = "en-us"
43+
TIME_ZONE = "UTC"
44+
USE_I18N = True
45+
USE_TZ = True
46+
STATIC_URL = "static/"
47+
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from django.http import HttpResponse
2+
from django.urls import path
3+
4+
5+
def healthz(_request):
6+
return HttpResponse("ok")
7+
8+
urlpatterns = [
9+
path("healthz/", healthz),
10+
]
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import os
2+
3+
from django.core.wsgi import get_wsgi_application
4+
5+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings")
6+
7+
application = get_wsgi_application()
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env python
2+
import os
3+
import sys
4+
5+
6+
def main() -> None:
7+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings")
8+
from django.core.management import execute_from_command_line
9+
10+
execute_from_command_line(sys.argv)
11+
12+
13+
if __name__ == "__main__":
14+
main()
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[project]
2+
name = "workflow-fixture-django-api-uv"
3+
version = "0.1.0"
4+
requires-python = ">=3.12"
5+
dependencies = [
6+
"django>=5.2,<6",
7+
"psycopg2-binary>=2.9",
8+
]
9+
10+
[dependency-groups]
11+
dev = [
12+
"pytest>=8.4",
13+
"pytest-cov>=6.1",
14+
"pytest-django>=4.11",
15+
]
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[pytest]
2+
DJANGO_SETTINGS_MODULE = config.settings

0 commit comments

Comments
 (0)