Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion artillery/generate-users-with-real-tokens.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ async function completeUserRegistration(email, password, name) {
};

const completeData = {
termIds: ["57d7b9cd-21d2-40dc-b64f-991c11852955"] // 약관 ID
termIds: ["a2774319-cd65-4e59-a0bf-b9f4b145af06"] // 약관 ID
};

const completeResponse = await makeRequest(completeOptions, completeData);
Expand Down
137 changes: 137 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@ export default [
globals: {
console: 'readonly',
process: 'readonly',
setImmediate: 'readonly',
clearImmediate: 'readonly',
setTimeout: 'readonly',
clearTimeout: 'readonly',
setInterval: 'readonly',
clearInterval: 'readonly',
Buffer: 'readonly',
__dirname: 'readonly',
__filename: 'readonly',
global: 'readonly',
module: 'readonly',
require: 'readonly',
exports: 'readonly',
},
},
plugins: {
Expand Down Expand Up @@ -55,6 +68,18 @@ export default [
afterAll: 'readonly',
jest: 'readonly',
require: 'readonly',
setImmediate: 'readonly',
clearImmediate: 'readonly',
setTimeout: 'readonly',
clearTimeout: 'readonly',
setInterval: 'readonly',
clearInterval: 'readonly',
Buffer: 'readonly',
__dirname: 'readonly',
__filename: 'readonly',
global: 'readonly',
module: 'readonly',
exports: 'readonly',
},
},
plugins: {
Expand Down Expand Up @@ -93,6 +118,18 @@ export default [
afterAll: 'readonly',
jest: 'readonly',
require: 'readonly',
setImmediate: 'readonly',
clearImmediate: 'readonly',
setTimeout: 'readonly',
clearTimeout: 'readonly',
setInterval: 'readonly',
clearInterval: 'readonly',
Buffer: 'readonly',
__dirname: 'readonly',
__filename: 'readonly',
global: 'readonly',
module: 'readonly',
exports: 'readonly',
},
},
plugins: {
Expand All @@ -110,4 +147,104 @@ export default [
'no-debugger': 'error',
},
},
// JavaScript 파일 설정
{
files: ['**/*.js'],
languageOptions: {
ecmaVersion: 2020,
sourceType: 'module',
globals: {
console: 'readonly',
process: 'readonly',
setImmediate: 'readonly',
clearImmediate: 'readonly',
setTimeout: 'readonly',
clearTimeout: 'readonly',
setInterval: 'readonly',
clearInterval: 'readonly',
Buffer: 'readonly',
__dirname: 'readonly',
__filename: 'readonly',
global: 'readonly',
module: 'readonly',
require: 'readonly',
exports: 'readonly',
},
},
plugins: {
prettier: prettier,
},
rules: {
'prettier/prettier': 'error',
'no-unused-vars': ['error', { 'argsIgnorePattern': '^_' }],
'no-console': 'off',
'no-debugger': 'error',
},
},
// k6 테스트 파일 설정
{
files: ['k6/**/*.js'],
languageOptions: {
ecmaVersion: 2020,
sourceType: 'module',
globals: {
console: 'readonly',
process: 'readonly',
// k6 전역 변수들
__ENV: 'readonly',
__VU: 'readonly',
open: 'readonly',
http: 'readonly',
check: 'readonly',
sleep: 'readonly',
Rate: 'readonly',
Trend: 'readonly',
SharedArray: 'readonly',
Counter: 'readonly',
Gauge: 'readonly',
Histogram: 'readonly',
group: 'readonly',
encoding: 'readonly',
crypto: 'readonly',
text: 'readonly',
b64decode: 'readonly',
b64encode: 'readonly',
hex: 'readonly',
md5: 'readonly',
sha1: 'readonly',
sha256: 'readonly',
sha384: 'readonly',
sha512: 'readonly',
hmac: 'readonly',
randomBytes: 'readonly',
randomIntBetween: 'readonly',
randomItem: 'readonly',
uuidv4: 'readonly',
URL: 'readonly',
URLSearchParams: 'readonly',
JSON: 'readonly',
Math: 'readonly',
Date: 'readonly',
setTimeout: 'readonly',
clearTimeout: 'readonly',
setInterval: 'readonly',
clearInterval: 'readonly',
console: 'readonly',
options: 'readonly',
setup: 'readonly',
teardown: 'readonly',
default: 'readonly',
},
},
plugins: {
prettier: prettier,
},
rules: {
'prettier/prettier': 'error',
'no-unused-vars': ['warn', { 'argsIgnorePattern': '^_' }],
'no-console': 'off',
'no-debugger': 'error',
'no-undef': 'off', // k6 전역 변수들을 위해 비활성화
},
},
];
2 changes: 1 addition & 1 deletion k6/enrollment-only-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const options = {

// 테스트 변수
const BASE_URL = __ENV.BASE_URL || 'http://mclass-alb-616483239.ap-northeast-2.elb.amazonaws.com';
const MCLASS_ID = '0ad687e8-57c4-4f27-b189-c730790b32de';
const MCLASS_ID = '1615d720-e902-43a9-82e4-7ab895916683';

// 유틸리티 함수
function generateUUID() {
Expand Down
35 changes: 10 additions & 25 deletions src/__tests__/enrollment/enrollment.service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,31 +212,13 @@ describe('EnrollmentService', () => {
idempotencyKey: 'test-key-123',
status: 'APPROVED', // 선착순 방식에서 정원 내면 즉시 승인
},
include: {
enrollmentForm: {
select: {
id: true,
isActive: true,
questions: true,
},
},
mclass: {
select: {
id: true,
title: true,
capacity: true,
selectionType: true,
visibility: true,
},
},
user: {
select: {
id: true,
name: true,
email: true,
},
},
},
select: {
id: true,
status: true,
appliedAt: true,
mclassId: true,
userId: true,
}, // 최소한만 선택
});
expect(result).toEqual(mockEnrollment);
});
Expand Down Expand Up @@ -806,6 +788,9 @@ describe('EnrollmentService', () => {

await service.enrollToClass('mclass-1', enrollmentData, 'user-1');

// 비동기 후처리를 기다리기 위해 process.nextTick 사용
await new Promise(resolve => process.nextTick(resolve));

// sendEnrollmentConfirmationEmail 메서드가 호출되었는지 확인
expect(service['sendEnrollmentConfirmationEmail']).toHaveBeenCalledWith(
'enrollment-1'
Expand Down
5 changes: 5 additions & 0 deletions src/config/prisma.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ export const prisma =
? ['query', 'error', 'warn']
: ['error'],
errorFormat: 'pretty',
// 트랜잭션 타임아웃 설정 추가
transactionOptions: {
timeout: 10000, // 10초
maxWait: 5000, // 최대 대기 시간
},
});

if (process.env.NODE_ENV !== 'production') {
Expand Down
Loading
Loading