ci: add PR quality and coverage gates
This commit is contained in:
@@ -1,3 +1,2 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
|
||||
@@ -2,7 +2,6 @@ from django.urls import path
|
||||
|
||||
from .views import LoginView, LogoutView, MeView, RegisterView, VisitorMigrationView
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
path("register/", RegisterView.as_view(), name="register"),
|
||||
path("login/", LoginView.as_view(), name="login"),
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import contextvars
|
||||
import logging
|
||||
|
||||
|
||||
request_id_context = contextvars.ContextVar("request_id", default="-")
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ import re
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
from django.db import connection
|
||||
|
||||
|
||||
MINIMUM_VERSION = (8, 0, 35)
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
|
||||
@@ -7,13 +7,11 @@ from channels.routing import ProtocolTypeRouter, URLRouter
|
||||
from django.core.asgi import get_asgi_application
|
||||
from django.urls import path
|
||||
|
||||
|
||||
django_asgi_application = get_asgi_application()
|
||||
|
||||
from common.consumers import HealthConsumer
|
||||
from contest.routing import websocket_urlpatterns
|
||||
|
||||
|
||||
application = ProtocolTypeRouter(
|
||||
{
|
||||
"http": django_asgi_application,
|
||||
|
||||
@@ -4,7 +4,6 @@ from pathlib import Path
|
||||
import dj_database_url
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
|
||||
|
||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||
PROJECT_ROOT = BASE_DIR.parent
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ from django.urls import include, path
|
||||
|
||||
from common.views import health, home
|
||||
|
||||
|
||||
admin.site.site_header = "葫芦数学运营后台"
|
||||
admin.site.site_title = "葫芦数学"
|
||||
admin.site.index_title = "内容与运营"
|
||||
|
||||
@@ -6,7 +6,6 @@ from progression.models import RewardTransaction, UserAbility
|
||||
|
||||
from .models import ContentInteraction, ContentItem, VideoProgress
|
||||
|
||||
|
||||
ABILITY_TO_DIMENSION = {
|
||||
ContentItem.Ability.VISION: UserAbility.Dimension.VISION,
|
||||
ContentItem.Ability.HUMANITIES: UserAbility.Dimension.HUMANITIES,
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
|
||||
@@ -8,7 +8,6 @@ from .views import (
|
||||
VideoCompleteView,
|
||||
)
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
path("", ContentListView.as_view(), name="content-list"),
|
||||
path("videos/catalog/", VideoCatalogView.as_view(), name="video-catalog"),
|
||||
|
||||
@@ -7,7 +7,6 @@ from rest_framework.views import APIView
|
||||
from .models import ContentInteraction, ContentItem, VideoProgress
|
||||
from .services import complete_video
|
||||
|
||||
|
||||
ABILITY_META = {
|
||||
ContentItem.Ability.VISION: {"label": "数学眼光", "icon": "◉", "color": "#5d73e8"},
|
||||
ContentItem.Ability.HUMANITIES: {"label": "数学人文", "icon": "▤", "color": "#b76d38"},
|
||||
|
||||
@@ -2,7 +2,6 @@ from django.core.management.base import BaseCommand
|
||||
|
||||
from contest.models import Contest, ContestQuestion, Question, QuestionVersion
|
||||
|
||||
|
||||
QUESTIONS = {
|
||||
Question.Track.BEGINNER: [
|
||||
("b-12-plus-19", "12 + 19", "31"),
|
||||
|
||||
@@ -2,7 +2,6 @@ from django.urls import path
|
||||
|
||||
from .consumers import MatchConsumer
|
||||
|
||||
|
||||
websocket_urlpatterns = [
|
||||
path("ws/v1/contest/matches/<uuid:match_id>/", MatchConsumer.as_asgi()),
|
||||
]
|
||||
|
||||
@@ -6,6 +6,7 @@ from django.utils import timezone
|
||||
from rest_framework.exceptions import ValidationError
|
||||
|
||||
from accounts.models import User
|
||||
|
||||
from .models import (
|
||||
CheatFlag,
|
||||
Contest,
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
|
||||
@@ -9,7 +9,6 @@ from .views import (
|
||||
MatchStateView,
|
||||
)
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
path("", ContestListView.as_view(), name="contest-list"),
|
||||
path("<slug:slug>/start/", AttemptStartView.as_view(), name="attempt-start"),
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
|
||||
@@ -3,7 +3,6 @@ from rest_framework.routers import DefaultRouter
|
||||
|
||||
from .views import CourseListView, ExerciseSubmitView, FormulaDocumentViewSet
|
||||
|
||||
|
||||
router = DefaultRouter()
|
||||
router.register("documents", FormulaDocumentViewSet, basename="formula-document")
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@ from math_life.models import (
|
||||
)
|
||||
from math_life.services import validate_story_content
|
||||
|
||||
|
||||
DISCIPLINE_ICONS = {
|
||||
"人工智能": "🤖",
|
||||
"计算机": "💻",
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
|
||||
@@ -9,7 +9,6 @@ from .views import (
|
||||
StoryStartView,
|
||||
)
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
path("mathbti/", MathBTIAssessmentView.as_view(), name="mathbti-assessment"),
|
||||
path("mathbti/submit/", MathBTISubmitView.as_view(), name="mathbti-submit"),
|
||||
|
||||
@@ -2,7 +2,6 @@ from django.contrib import admin
|
||||
|
||||
from .models import Card, RewardTransaction, UserAbility, UserCard, UserPet
|
||||
|
||||
|
||||
admin.site.register(UserPet)
|
||||
admin.site.register(UserAbility)
|
||||
admin.site.register(Card)
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
|
||||
@@ -2,7 +2,6 @@ from django.urls import path
|
||||
|
||||
from .views import ProgressionProfileView
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
path("me/", ProgressionProfileView.as_view(), name="progression-profile"),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user