Skip to content

Commit

Permalink
Merge pull request #17 from J-hoplin1/fix/hotfix-0109
Browse files Browse the repository at this point in the history
Fix: Fix swagger and add e2e-test github action
  • Loading branch information
J-Hoplin authored Jan 8, 2024
2 parents 86570a9 + 929a37f commit e9e5740
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 42 deletions.
100 changes: 100 additions & 0 deletions .github/workflows/pre-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: CI-Unit-Test
on:
pull_request:
branches:
- dev
workflow_call:
inputs:
build_id:
required: true
type: number
deploy_target:
required: true
type: string
run-name: Unit/E2E test of ${{ github.ref_name }} by ${{ github.actor }}
jobs:
unit-testing:
runs-on: ubuntu-latest
steps:
# Checkout repository codes
- name: Repository Checkout
uses: actions/checkout@v4
# Setup environment for Node.js 18
- name: Node.js version 18 Environment setting
uses: actions/setup-node@v4
with:
node-version: 18
- name: Initialize .ci.env
run: |
touch .ci.env
echo "DATABASE_URL=${{ secrets.DATABASE_URL}}" >> .ci.env
echo "ADMIN_EMAIL=${{secrets.ADMIN_EMAIL}}" >> .ci.env
echo "ADMIN_PW=${{secrets.ADMIN_PW}}" >> .ci.env
echo "JWT_SECRET=${{secrets.JWT_SECRET}}" >> .ci.env
echo "JUDGE_SERVER_ENDPOINT=${{secrets.JUDGE_SERVER_ENDPOINT}}" >> .ci.env
- name: Install Node.js Dependencies
run: npm install --force
- name: Install dotenv-cli for dotenv cli
run: npm install -g dotenv-cli
- name: Initialize Prisma Client
run: npm run ci:init
- id: unit-test-phase
name: Run Unit Test
run: npm run ci:unit
- name: 'Discord Alert - Success'
if: steps.unit-test-phase.outcome == 'success'
continue-on-error: true
uses: rjstone/discord-webhook-notify@v1
with:
severity: info
details: 'Unit Test Result: Success'
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
- name: 'Discord Alert - Failed'
if: steps.unit-test-phase.outcome != 'success'
uses: rjstone/discord-webhook-notify@v1
with:
severity: error
details: 'Unit Test Result: Fail'
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}

e2e-testing:
runs-on: ubuntu-latest
steps:
- name: Repository Checkout
uses: actions/checkout@v4
- name: Node.js version 18 Environment setting
uses: actions/setup-node@v4
with:
node-version: 18
- name: Initialize .ci.env
run: |
touch .ci.env
echo "DATABASE_URL=${{ secrets.DATABASE_URL}}" >> .ci.env
echo "ADMIN_EMAIL=${{secrets.ADMIN_EMAIL}}" >> .ci.env
echo "ADMIN_PW=${{secrets.ADMIN_PW}}" >> .ci.env
echo "JWT_SECRET=${{secrets.JWT_SECRET}}" >> .ci.env
echo "JUDGE_SERVER_ENDPOINT=${{secrets.JUDGE_SERVER_ENDPOINT}}" >> .ci.env
- name: Install Node.js Dependencies
run: npm install --force
- name: Install dotenv-cli for dotenv cli
run: npm install -g dotenv-cli
- name: Initialize Prisma Client
run: npm run ci:init
- id: e2e-test-phase
name: Run E2E Test
run: npm run ci:e2e
- name: 'Discord Alert - Success'
if: steps.e2e-test-phase.outcome == 'success'
continue-on-error: true
uses: rjstone/discord-webhook-notify@v1
with:
severity: info
details: 'E2E Test Result: Success'
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
- name: 'Discord Alert - Fail'
if: steps.e2e-test-phase.outcome != 'success'
uses: rjstone/discord-webhook-notify@v1
with:
severity: error
details: 'E2E Test Result: Failed'
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
42 changes: 0 additions & 42 deletions .github/workflows/unit-test.yml

This file was deleted.

3 changes: 3 additions & 0 deletions src/judge/judge.docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
} from './response';
import { SubmissionFilterDocs } from './decorator/submission-filter.decorator';
import { PaginationDocs } from 'app/decorator';
import { JudgeFilterDocs } from './decorator/judge-filter.decorator';

export class JudgeDocs {
public static Controller() {
Expand All @@ -33,6 +34,7 @@ export class JudgeDocs {
ApiOperation({ summary: '문제 리스트 출력' }),
ApiOkResponse({ type: ListProblemResponse, isArray: true }),
...PaginationDocs,
...JudgeFilterDocs,
);
}

Expand Down Expand Up @@ -76,6 +78,7 @@ export class JudgeDocs {
ApiOperation({ summary: '사용자 Submission 리스트' }),
ApiOkResponse({ type: ListUserSubmissionRepsonse, isArray: true }),
...SubmissionFilterDocs,
...PaginationDocs,
);
}
}

0 comments on commit e9e5740

Please sign in to comment.