Skip to content

Commit

Permalink
Merge pull request #30 from boostcampwm-2024/dev
Browse files Browse the repository at this point in the history
배포용 PR
  • Loading branch information
tuchongkim authored Jan 21, 2025
2 parents bce054f + 4099db6 commit 0a56846
Show file tree
Hide file tree
Showing 14 changed files with 2,693 additions and 374 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Deploy Dev in Monorepo
name: Deploy Main in Monorepo

on:
push:
branches:
- dev
- main

jobs:
build-and-deploy:
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ docker compose up -d

## 👨‍🎓 팀원

| Backend | Backend | Backend | Frontend |
| :-------------------------------------: | :----------------------------------------------------------: | :----------------------------------------: | :--------------------------------------: |
| ![img](https://github.com/xjfcnfw3.png) | ![img](https://avatars.githubusercontent.com/u/52474291?v=4) | ![img](https://github.com/demian-m00n.png) | ![img](https://github.com/baegyeong.png) |
| [김민수](https://github.com/xjfcnfw3) | [김성환](https://github.com/swkim12345) | [문설민](https://github.com/demian-m00n) | [조배경](https://github.com/baegyeong) |
| Backend | Backend | Backend |
|:-------------------------------------------------------------:|:------------------------------------------------------------:|:--------------------------------------------------------:|
| ![img](https://avatars.githubusercontent.com/u/113917771?v=4) | ![img](https://avatars.githubusercontent.com/u/49023732?v=4) | ![img](https://avatars.githubusercontent.com/u/50190387) |
| [곽희상](https://github.com/KWAKMANBO) | [김두종](https://github.com/tuchongkim) | [유동훈](https://github.com/DongHoonYu96) |
15 changes: 15 additions & 0 deletions nGrinder/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
services:
controller:
image: ngrinder/controller
restart: always
ports:
- "9000:80"
- "16001:16001"
- "12000-12009:12000-12009"
volumes:
- ~/ngrinder-controller:/opt/ngrinder-controller
agent:
image: ngrinder/agent
restart: always
links:
- controller
112 changes: 112 additions & 0 deletions nGrinder/script/main_page_load_test.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
import static net.grinder.script.Grinder.grinder
import static org.junit.Assert.*
import static org.hamcrest.Matchers.*
import net.grinder.script.GTest
import net.grinder.script.Grinder
import net.grinder.scriptengine.groovy.junit.GrinderRunner
import net.grinder.scriptengine.groovy.junit.annotation.BeforeProcess
import net.grinder.scriptengine.groovy.junit.annotation.BeforeThread
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.ngrinder.http.HTTPRequest
import org.ngrinder.http.HTTPRequestControl
import org.ngrinder.http.HTTPResponse
import org.ngrinder.http.cookie.Cookie
import org.ngrinder.http.cookie.CookieManager

@RunWith(GrinderRunner)
class TestRunner {

public static GTest test
public static HTTPRequest request
public static Map<String, String> headers = [:]
public static Map<String, Object> params = [:]
public static List<Cookie> cookies = []

@BeforeProcess
public static void beforeProcess() {
HTTPRequestControl.setConnectionTimeout(300000)
test = new GTest(1, "juchumjuchum.site")
request = new HTTPRequest()
grinder.logger.info("before process.")
}

@BeforeThread
public void beforeThread() {
test.record(this, "testThemeChange")
test.record(this, "testStockFluctuation")
test.record(this, "testTopViews")
test.record(this, "testIndex")
test.record(this, "testStatus")
grinder.statistics.delayReports = true
grinder.logger.info("before thread.")
}

@Before
public void before() {
request.setHeaders(headers)
CookieManager.addCookies(cookies)
grinder.logger.info("before. init headers and cookies")
}

@Test
public void testThemeChange() {
HTTPResponse response = request.GET("http://juchumjuchum.site/api/user/theme")
if (response.statusCode == 301 || response.statusCode == 302) {
grinder.logger.warn("Warning. The response may not be correct. The response code was {}.", response.statusCode)
} else {
assertThat(response.statusCode, is(200))
if (response.statusCode != 200) {
grinder.logger.warn("Warning. The response may not be correct. The response code was {}.", response.statusCode)
}
}
}


@Test
public void testStockFluctuation() {
Map<String, Object> params = ["limit": "10", "type": "increase"]
HTTPResponse response = request.GET("http://juchumjuchum.site/api/stock/fluctuation", params)
if (response.statusCode == 301 || response.statusCode == 302) {
grinder.logger.warn("Warning. The response may not be correct. The response code was {}.", response.statusCode)
} else {
grinder.logger.info("Response Status Code: ${response.statusCode}")
assertThat(response.statusCode, is(200))
}
}

@Test
public void testTopViews() {
Map<String, Object> params = ["limit": "5"]
HTTPResponse response = request.GET("http://juchumjuchum.site/api/stock/topViews", params)
if (response.statusCode == 301 || response.statusCode == 302) {
grinder.logger.warn("Warning. The response may not be correct. The response code was {}.", response.statusCode)
} else {
grinder.logger.info("Response Status Code: ${response.statusCode}")
assertThat(response.statusCode, is(200))
}
}

@Test
public void testIndex() {
HTTPResponse response = request.GET("http://juchumjuchum.site/api/stock/index")
if (response.statusCode == 301 || response.statusCode == 302) {
grinder.logger.warn("Warning. The response may not be correct. The response code was {}.", response.statusCode)
} else {
grinder.logger.info("Response Status Code: ${response.statusCode}")
assertThat(response.statusCode, is(200))
}
}

@Test
public void testStatus() {
HTTPResponse response = request.GET("http://juchumjuchum.site/api/auth/status")
if (response.statusCode == 301 || response.statusCode == 302) {
grinder.logger.warn("Warning. The response may not be correct. The response code was {}.", response.statusCode)
} else {
grinder.logger.info("Response Status Code: ${response.statusCode}")
assertThat(response.statusCode, is(200))
}
}
}
Loading

0 comments on commit 0a56846

Please sign in to comment.