Skip to content

Commit e978a93

Browse files
committed
chore: mysql 컨테이너 기다리게 수정
1 parent 753664a commit e978a93

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

.github/workflows/dev-build.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: log4u-dev-build
1+
name: dev-build
22
on:
33
pull_request:
44
branches:
@@ -46,6 +46,21 @@ jobs:
4646
-p 3307:3306 \
4747
mysql:8.0.33
4848
49+
- name: Wait for MySQL to be ready
50+
run: |
51+
for i in {1..10}; do
52+
if docker exec log4u-mysql mysqladmin ping -h "127.0.0.1" --silent; then
53+
echo "MySQL is ready!"
54+
break
55+
fi
56+
echo "Waiting for MySQL to start..."
57+
sleep 1
58+
done
59+
if ! docker exec log4u-mysql mysqladmin ping -h "127.0.0.1" --silent; then
60+
echo "MySQL did not start in time!"
61+
exit 1
62+
fi
63+
4964
- name: Build and analyze
5065
env:
5166
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

src/test/java/com/example/log4u/domain/follow/FollowTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ void createFollowFailureWithUserNotFound() {
6969
.isPremium(false)
7070
.build();
7171

72-
userRepository.save(user);
72+
final Long userId = userRepository.save(user).getUserId();
7373

7474
assertThrows(UserNotFoundException.class,
75-
() -> followService.createFollow(user.getUserId(), WRONG_TARGET));
75+
() -> followService.createFollow(userId, WRONG_TARGET));
7676
}
7777

7878
@Test

0 commit comments

Comments
 (0)