Skip to content

Commit

Permalink
Configure test environment
Browse files Browse the repository at this point in the history
  • Loading branch information
mkSpace committed Jan 4, 2024
1 parent 0303eb6 commit da5800e
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 20 deletions.
28 changes: 25 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ jobs:
build:
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v3

Expand All @@ -30,5 +29,28 @@ jobs:
format: YYYY-MM-DDTHH-mm-ss
utcOffset: "+09:00"

- name: build test
run: chmod +x gradlew && ./gradlew build
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew build -x test

- name: Test with Gradle
run: SPRING_PROFILES_ACTIVE=[test] ./gradlew test

- name: Copy Test Results
if: always()
run: |
cp -Lpr **/test-results/**/*.xml test-results
cp -Lpr **/test-results/**/*.trx test-results
cp -Lpr **/test-results/**/*.json test-results
shell: bash

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: |
test-results/**/*.xml
test-results/**/*.trx
test-results/**/*.json
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ subprojects {
// SpringMockk
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("com.ninja-squad:springmockk:3.1.1")

testRuntimeOnly("com.h2database:h2")
}

tasks.withType<KotlinCompile> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ jwt:
secret-key: ENC(nFedRKX5zt00VoNk/11zZcZVAtdnl/AHTDJW74urxj103ameypl1NctWnJYl90thp8OS/DIP8B0oHXgvMVJ02TPFiMZes3Kf3/EPG9t/MnUKvjc4iz1HZ+F76oDcvxXheKiioRZkGt1b0g9iyh7PW4CKSo5T/rScgXsg2c+05bg=)

spring:
servlet:
multipart:
max-file-size: 10MB
max-request-size: 10MB
config:
activate:
on-profile: dev
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ jwt:
secret-key: ENC(nFedRKX5zt00VoNk/11zZcZVAtdnl/AHTDJW74urxj103ameypl1NctWnJYl90thp8OS/DIP8B0oHXgvMVJ02TPFiMZes3Kf3/EPG9t/MnUKvjc4iz1HZ+F76oDcvxXheKiioRZkGt1b0g9iyh7PW4CKSo5T/rScgXsg2c+05bg=)

spring:
servlet:
multipart:
max-file-size: 10MB
max-request-size: 10MB
config:
activate:
on-profile: prod
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
spring:
servlet:
multipart:
max-file-size: 10MB
max-request-size: 10MB
config:
activate:
on-profile: test

datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: ENC(XipKlkEc8VLlKgM59OC01yV9WC2y7t7TISTVBYLuQG3CGPz/ph3dSwxtNMxjhJ548592hcelCVmuzEuRJJPP2dS6//yQrpBdBbujHL4m9c4=)
username: ENC(n1+fm+uUm/VLP6b0uTsVjeHAkMIobcWsdcfMqW+d8lvMUJKMH/jv9Se7C9hY6pG1)
password: ENC(wjhc+VfBjNy+DbgceiG+2/4CPBkLFiDaGqSjjyMRaThj/XtXkWNgPQSQuN4FO0Ge)
driver-class-name: org.h2.Driver
url: jdbc:h2:mem:~/raisedragon
username: sa
password:

jpa:
database: mysql
hibernate:
ddl-auto: create-drop
properties:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
spring:
profiles:
default: dev

servlet:
multipart:
max-file-size: 10MB
max-request-size: 10MB
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.whatever.raisedragon

import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.data.jpa.repository.config.EnableJpaAuditing

@SpringBootApplication
@EnableJpaAuditing
class RaiseDragonApplicationTests

0 comments on commit da5800e

Please sign in to comment.