-
Notifications
You must be signed in to change notification settings - Fork 2
[POC] end-to-end Integration test #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
banadiga
wants to merge
10
commits into
master
Choose a base branch
from
integration-tests
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
11f3ab2
Integration test inited
banadiga f77ddbd
wrapper fixed
banadiga ca73972
fixed after code review
banadiga e20f028
Replaced hard coded hosts and ports
banadiga a3a5352
remove default value from docker-compose.yml, remove spring.cloud.con…
banadiga 7323b59
rebased and Integration test RF
banadiga 1d1d539
management.security.enabled=false
banadiga 685279e
docker-compose fix added
banadiga b9f92fb
end to end test fixed
banadiga c3a9dc1
some improvements
banadiga File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM java:8 | ||
|
||
RUN mkdir -p /opt/spring-cloud | ||
WORKDIR /opt/spring-cloud | ||
|
||
ADD api-gateway-service.jar api-gateway-service.jar | ||
ADD wrapper.sh wrapper.sh | ||
|
||
RUN bash -c 'chmod +x ./wrapper.sh' | ||
RUN bash -c 'touch ./api-gateway-service.jar' | ||
|
||
ENTRYPOINT ["/bin/bash", "./wrapper.sh"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/bash | ||
|
||
WAITING_FOR_DEPENDENCE=${WAITING_FOR_DEPENDENCE:='false'} | ||
|
||
if [ "$WAITING_FOR_DEPENDENCE" != "true" ]; then | ||
echo "Starting api-gateway server immediately" | ||
java -jar ./api-gateway-service.jar | ||
exit 0 | ||
fi | ||
|
||
DISCOVERY_SERVER_HOST=${DISCOVERY_SERVER_HOST:='discovery-server'} | ||
DISCOVERY_SERVER_PORT=${DISCOVERY_SERVER_PORT:=8761} | ||
|
||
echo "Trying to connect to discovery server on ${DISCOVERY_SERVER_HOST}:${DISCOVERY_SERVER_PORT}" | ||
until $(curl --output /dev/null --silent --head --fail "http://${DISCOVERY_SERVER_HOST}:${DISCOVERY_SERVER_PORT}/info"); do | ||
echo -e ".\c" | ||
sleep 1 | ||
done | ||
echo | ||
|
||
REALTOR_SERVICE=${REALTOR_SERVICE:='realtor-service'} | ||
echo "Trying to get '${REALTOR_SERVICE}' from ${DISCOVERY_SERVER_HOST}:${DISCOVERY_SERVER_PORT}" | ||
until $(curl --output /dev/null --silent --head --fail "http://${DISCOVERY_SERVER_HOST}:${DISCOVERY_SERVER_PORT}/eureka/apps/${REALTOR_SERVICE}"); do | ||
echo -e ".\c" | ||
sleep 1 | ||
done | ||
echo | ||
|
||
CLIENT_SERVICE=${CLIENT_SERVICE:='client-service'} | ||
echo "Trying to get '${CLIENT_SERVICE}' from ${DISCOVERY_SERVER_HOST}:${DISCOVERY_SERVER_PORT}" | ||
until $(curl --output /dev/null --silent --head --fail "http://${DISCOVERY_SERVER_HOST}:${DISCOVERY_SERVER_PORT}/eureka/apps/${CLIENT_SERVICE}"); do | ||
echo -e ".\c" | ||
sleep 1 | ||
done | ||
echo | ||
|
||
echo "Starting api-gateway server" | ||
echo "Setting eureka.client.serviceUrl.defaultZone to http://${DISCOVERY_SERVER_HOST}:${DISCOVERY_SERVER_PORT}/eureka" | ||
echo | ||
env "eureka.client.serviceUrl.defaultZone=http://${DISCOVERY_SERVER_HOST}:${DISCOVERY_SERVER_PORT}/eureka" \ | ||
java -jar ./api-gateway-service.jar |
2 changes: 1 addition & 1 deletion
2
...a/jclub/ApiGatewayServiceApplication.java → ...gateway/ApiGatewayServiceApplication.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 13 additions & 1 deletion
14
api-gateway-service/src/main/resources/application.properties
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,14 @@ | ||
spring.application.name=api-gateway-service | ||
server.port=8090 | ||
server.port=8090 | ||
|
||
eureka.instance.preferIpAddress=true | ||
|
||
feign.hystrix.enabled=true | ||
|
||
management.security.enabled=false | ||
|
||
endpoints.info.id=info | ||
endpoints.info.sensitive=false | ||
endpoints.info.enabled=true | ||
|
||
info.app.name=Api gateway service |
2 changes: 1 addition & 1 deletion
2
...ub/ApiGatewayServiceApplicationTests.java → ...ay/ApiGatewayServiceApplicationTests.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
eureka.client.enabled=false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
_______________________ ___ _ __ _ | ||
/_ __/ ____/ ___/_ __/ / | ____ (_) ____ _____ _/ /____ _ ______ ___ __ ________ ______ __(_)_______ | ||
/ / / __/ \__ \ / / / /| | / __ \/ / / __ `/ __ `/ __/ _ \ | /| / / __ `/ / / / / ___/ _ \/ ___/ | / / / ___/ _ \ | ||
/ / / /___ ___/ // / / ___ |/ /_/ / / / /_/ / /_/ / /_/ __/ |/ |/ / /_/ / /_/ / (__ ) __/ / | |/ / / /__/ __/ | ||
/_/ /_____//____//_/ /_/ |_/ .___/_/ \__, /\__,_/\__/\___/|__/|__/\__,_/\__, / /____/\___/_/ |___/_/\___/\___/ | ||
/_/ /____/ /____/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<configuration> | ||
|
||
<include resource="org/springframework/boot/logging/logback/base.xml"/> | ||
|
||
<logger name="org.testcontainers" level="INFO"/> | ||
<logger name="org.testcontainers.shaded.com.github.dockerjava.core.async.ResultCallbackTemplate" level="OFF"/> | ||
</configuration> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM java:8 | ||
|
||
RUN mkdir -p /opt/spring-cloud | ||
WORKDIR /opt/spring-cloud | ||
|
||
ADD client-service.jar client-service.jar | ||
ADD wrapper.sh wrapper.sh | ||
|
||
RUN bash -c 'chmod +x ./wrapper.sh' | ||
RUN bash -c 'touch ./client-service.jar' | ||
|
||
ENTRYPOINT ["/bin/bash", "./wrapper.sh"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
WAITING_FOR_DEPENDENCE=${WAITING_FOR_DEPENDENCE:='false'} | ||
|
||
if [ "$WAITING_FOR_DEPENDENCE" != "true" ]; then | ||
echo "Starting config server immediately" | ||
java -jar ./client-service.jar | ||
exit 0 | ||
fi | ||
|
||
DISCOVERY_SERVER_HOST=${DISCOVERY_SERVER_HOST:='discovery-server'} | ||
DISCOVERY_SERVER_PORT=${DISCOVERY_SERVER_PORT:=8761} | ||
|
||
echo "Trying to connect to discovery server on ${DISCOVERY_SERVER_HOST}:${DISCOVERY_SERVER_PORT}" | ||
until $(curl --output /dev/null --silent --head --fail "http://${DISCOVERY_SERVER_HOST}:${DISCOVERY_SERVER_PORT}/info"); do | ||
echo -e ".\c" | ||
sleep 1 | ||
done | ||
echo | ||
|
||
STORAGE_SERVICE=${STORAGE_SERVICE:='storage-service'} | ||
echo "Trying to get '${STORAGE_SERVICE}' from ${DISCOVERY_SERVER_HOST}:${DISCOVERY_SERVER_PORT}" | ||
until $(curl --output /dev/null --silent --head --fail "http://${DISCOVERY_SERVER_HOST}:${DISCOVERY_SERVER_PORT}/eureka/apps/${STORAGE_SERVICE}"); do | ||
echo -e ".\c" | ||
sleep 1 | ||
done | ||
echo | ||
|
||
echo "Starting client service" | ||
echo "Setting eureka.client.serviceUrl.defaultZone to http://${DISCOVERY_SERVER_HOST}:${DISCOVERY_SERVER_PORT}/eureka" | ||
echo | ||
env "eureka.client.serviceUrl.defaultZone=http://${DISCOVERY_SERVER_HOST}:${DISCOVERY_SERVER_PORT}/eureka" \ | ||
java -jar ./client-service.jar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this file is autogenerated ? If yes then do we need it to be pushed ? If no then should we always maintain it and support configuration ?