Skip to content

Commit

Permalink
Merge pull request #437 from sparcs-kaist/#436-merge-sample-generator
Browse files Browse the repository at this point in the history
#436 taxi-sample-generator 병합
  • Loading branch information
kmc7468 authored Jan 23, 2024
2 parents a44467e + a17c3ef commit db03037
Show file tree
Hide file tree
Showing 20 changed files with 613 additions and 171 deletions.
7 changes: 7 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,10 @@ CORS_WHITELIST=[CORS 정책에서 허용하는 도메인의 목록(e.g. ["http:/
GOOGLE_APPLICATION_CREDENTIALS=[GOOGLE_APPLICATION_CREDENTIALS JSON]
TEST_ACCOUNTS=[스팍스SSO로 로그인시 무조건 테스트로 로그인이 가능한 허용 아이디 목록]
SLACK_REPORT_WEBHOOK_URL=[Slack 웹훅 URL들이 담긴 JSON]

# optional environment variables for taxiSampleGenerator
SAMPLE_NUM_OF_ROOMS=[방의 개수]
SAMPLE_NUM_OF_CHATS=[각 방의 채팅 개수]
SAMPLE_MAXIMUM_INTERVAL_BETWEEN_CHATS=[채팅 간 최대 시간 간격(단위: 초, 실수도 가능)]
SAMPLE_OCCURENCE_OF_JOIN=[새로운 채팅이 입장 메세지일 확률(0 ~ 1 사이의 값)]
SAMPLE_OCCURENCE_OF_ABORT=[새로운 채팅이 퇴장 메세지일 확률(0 ~ 1 사이의 값)]
14 changes: 0 additions & 14 deletions .github/workflows/test_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,6 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- id: submodule-local
name: Save local version of submodule
run: echo "ver=`cd sampleGenerator && git log --pretty="%h" -1 && cd ..`" >> $GITHUB_OUTPUT
- id: submodule-origin
name: Save origin version of submodule
run: echo "ver=`cd sampleGenerator && git log origin --pretty="%h" -1 && cd ..`" >> $GITHUB_OUTPUT
- name: Check submodule version
if: ${{ steps.submodule-local.outputs.ver != steps.submodule-origin.outputs.ver }}
uses: actions/github-script@v3
with:
script: |
core.setFailed('Please update submodule to the latest version by using \"git submodule update --remote\"')
- name: Install sampleGenerator dependencies from package-lock.json
run: cd sampleGenerator && pnpm i --force --frozen-lockfile && cd ..
- name: Install taxi-back dependencies from package-lock.json
run: pnpm i --force --frozen-lockfile
- name: Run unit tests
Expand Down
4 changes: 0 additions & 4 deletions .gitmodules

This file was deleted.

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,3 @@ See [contributors](https://github.com/sparcs-kaist/taxi-front/graphs/contributor
- app : https://github.com/sparcs-kaist/taxi-app
- docker : https://github.com/sparcs-kaist/taxi-docker
- figma : https://www.figma.com/file/li34hP1oStJAzLNjcG5KjN/SPARCS-Taxi?node-id=0%3A1
- taxiSampleGenerator : https://github.com/sparcs-kaist/taxiSampleGenerator
9 changes: 7 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
// 모듈 require
const express = require("express");
const http = require("http");
const { nodeEnv, port: httpPort, eventConfig } = require("./loadenv");
const {
nodeEnv,
port: httpPort,
eventConfig,
mongo: mongoUrl,
} = require("./loadenv");
const logger = require("./src/modules/logger");
const { connectDatabase } = require("./src/modules/stores/mongo");
const { startSocketServer } = require("./src/modules/socket");
Expand All @@ -13,7 +18,7 @@ require("./src/modules/fcm").initializeApp();
const app = express();

// 데이터베이스 연결
connectDatabase();
connectDatabase(mongoUrl);

// [Middleware] request body 파싱
app.use(express.urlencoded({ extended: false }));
Expand Down
2 changes: 1 addition & 1 deletion loadenv.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ module.exports = {
slackWebhookUrl: {
report: process.env.SLACK_REPORT_WEBHOOK_URL || "", // optional
},
eventConfig: process.env.EVENT_CONFIG && JSON.parse(process.env.EVENT_CONFIG),
eventConfig: process.env.EVENT_CONFIG && JSON.parse(process.env.EVENT_CONFIG), // optional
};
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"serve": "cross-env TZ='Asia/Seoul' NODE_ENV=production node app.js",
"runscript": "cross-env TZ='Asia/Seoul' NODE_ENV=production node",
"lint": "npx eslint --fix .",
"sample": "cd sampleGenerator && npm start && cd .."
"sample": "cd src/sampleGenerator && npm start && cd .."
},
"engines": {
"node": ">=18.0.0",
Expand Down Expand Up @@ -60,7 +60,7 @@
"eslint": "^8.22.0",
"eslint-plugin-mocha": "^10.1.0",
"mocha": "^10.2.0",
"mongodb": "^6.2.0",
"mongodb": "^4.1.0",
"nodemon": "^3.0.1",
"supertest": "^6.2.4"
}
Expand Down
Loading

0 comments on commit db03037

Please sign in to comment.