Skip to content

Commit

Permalink
refactor: removed docker compose version, renamed some steps within t…
Browse files Browse the repository at this point in the history
…he build job, removed docker compose logs from script
  • Loading branch information
usuletw022 committed Mar 26, 2024
1 parent 0438416 commit c90e951
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 19 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/end-to-end-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
build-and-test:
name: Build docker and Run E2E Tests
name: Install docker and Run E2E Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -15,9 +15,8 @@ jobs:
go-version: '1.20'
- name: Install Docker Compose
run: |
sudo apt-add-repository ppa:mosquitto-dev/mosquitto-ppa
sudo apt-get update
sudo apt-get install docker-compose
docker-compose --version
- name: Build and Start Docker Compose
- name: Build docker and Run E2E Tests
run: ./e2e_tests/run-e2e-tests.sh
2 changes: 0 additions & 2 deletions e2e_tests/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.5"

networks:
default:
name: maeve-csms
Expand Down
20 changes: 6 additions & 14 deletions e2e_tests/run-e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ start_docker_compose_for_everest() {

echo "Waiting for services to initialize..."
sleep 30
docker-compose logs
}

# Function to stop Docker Compose
Expand Down Expand Up @@ -74,21 +73,14 @@ check_health_endpoint() {
run_tests() {
echo "Running test command..."
cd "$TEST_DIR"
# Run your command and redirect stderr to /dev/null
go test --tags=e2e -v ./... -count=1
# Check the exit code of the command
if [ $? -ne 0 ]; then
echo "Error: Process completed with exit code 1 ignored."
fi
# TEST_RESULT=$?
docker-compose logs
TEST_RESULT=$?
cd "$CSMS_DIR"
docker-compose logs
# if [ $TEST_RESULT -eq 0 ]; then
# echo "Tests completed successfully"
# else
# echo "Tests failed"
# fi
if [ $TEST_RESULT -eq 0 ]; then
echo "Tests completed successfully"
else
echo "Tests failed"
fi

stop_docker_compose_for_everest
stop_docker_compose_for_maeve_csms
Expand Down

0 comments on commit c90e951

Please sign in to comment.