Skip to content

Commit

Permalink
restructure tox
Browse files Browse the repository at this point in the history
  • Loading branch information
rasswanth-s committed Oct 13, 2023
1 parent a4dd625 commit c8da625
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -634,28 +634,19 @@ commands =
# bash -c "k3d cluster delete test-domain-2 || true"

# Deleting registery & volumes

bash -c "k3d registry delete k3d-registry.localhost || true"
bash -c "docker volume rm k3d-test-gateway-1-images --force || true"
bash -c "docker volume rm k3d-test-domain-1-images --force || true"
# bash -c "docker volume rm k3d-test-domain-2-images --force || true"

# Creating registory & nodes
# Creating registory
bash -c 'k3d registry create registry.localhost --port 12345 -v `pwd`/k3d-registry:/var/lib/registry || true'

# Creating test-gateway-1 cluster on port 9081
bash -c 'NODE_NAME=test-gateway-1 NODE_PORT=9081 && \
k3d cluster create $NODE_NAME -p "$NODE_PORT:80@loadbalancer" --registry-use k3d-registry.localhost || true \
k3d cluster start $NODE_NAME'

# bash -c 'NODE_NAME=test-gateway-1 NODE_PORT=9081 && \
# cd packages/grid && \
# devspace --no-warn --kube-context "k3d-$NODE_NAME" --namespace $NODE_NAME \
# --var DOMAIN_NAME=$NODE_NAME \
# --var NETWORK_CHECK_INTERVAL=5 \
# --var TEST_MODE=1 \
# --var CONTAINER_REGISTRY=k3d-registry.localhost:12345 \
# build -b'

bash -c 'NODE_NAME=test-gateway-1 NODE_PORT=9081 && \
cd packages/grid && \
(r=5;while ! \
Expand All @@ -665,9 +656,11 @@ commands =
--var ASSOCIATION_TIMEOUT=100 \
--var TEST_MODE=1 \
--var CONTAINER_REGISTRY=k3d-registry.localhost:12345 \
deploy -b -p gateway; \
--var NODE_TYPE=gateway \
deploy -b; \
do ((--r))||exit;echo "retrying" && sleep 20;done)'

# Creating test-domain-1 cluster on port 9082
bash -c 'NODE_NAME=test-domain-1 NODE_PORT=9082 && \
k3d cluster create $NODE_NAME -p "$NODE_PORT:80@loadbalancer" --registry-use k3d-registry.localhost || true \
k3d cluster start $NODE_NAME'
Expand Down Expand Up @@ -710,27 +703,23 @@ commands =
bash packages/grid/scripts/wait_for.sh service mongo --context k3d-test-gateway-1 --namespace test-gateway-1
bash packages/grid/scripts/wait_for.sh service backend --context k3d-test-gateway-1 --namespace test-gateway-1
bash packages/grid/scripts/wait_for.sh service proxy --context k3d-test-gateway-1 --namespace test-gateway-1


# bash packages/grid/scripts/wait_for.sh service queue --context k3d-test-gateway-1 --namespace test-gateway-1
# bash packages/grid/scripts/wait_for.sh service redis --context k3d-test-gateway-1 --namespace test-gateway-1

# bash packages/grid/scripts/wait_for.sh service backend-stream --context k3d-test-gateway-1 --namespace test-gateway-1
# bash packages/grid/scripts/wait_for.sh service headscale --context k3d-test-gateway-1 --namespace test-gateway-1

# wait for test domain 1
bash packages/grid/scripts/wait_for.sh service mongo --context k3d-test-domain-1 --namespace test-domain-1
bash packages/grid/scripts/wait_for.sh service backend --context k3d-test-domain-1 --namespace test-domain-1
bash packages/grid/scripts/wait_for.sh service proxy --context k3d-test-domain-1 --namespace test-domain-1


# bash packages/grid/scripts/wait_for.sh service frontend --context k3d-test-domain-1 --namespace test-domain-1
# bash packages/grid/scripts/wait_for.sh service proxy --context k3d-test-domain-1 --namespace test-domain-1
# bash packages/grid/scripts/wait_for.sh service queue --context k3d-test-domain-1 --namespace test-domain-1
# bash packages/grid/scripts/wait_for.sh service redis --context k3d-test-domain-1 --namespace test-domain-1
# bash packages/grid/scripts/wait_for.sh service backend-stream --context k3d-test-domain-1 --namespace test-domain-1
# bash packages/grid/scripts/wait_for.sh service seaweedfs --context k3d-test-domain-1 --namespace test-domain-1

# wait for test domain 2
# bash packages/grid/scripts/wait_for.sh service frontend --context k3d-test-domain-2 --namespace test-domain-2
# bash packages/grid/scripts/wait_for.sh service proxy --context k3d-test-domain-2 --namespace test-domain-2
# bash packages/grid/scripts/wait_for.sh service queue --context k3d-test-domain-2 --namespace test-domain-2
Expand All @@ -745,7 +734,10 @@ commands =

# Checking logs generated & startup of test-domain 1
bash -c '(kubectl logs service/backend --context k3d-test-domain-1 --namespace test-domain-1 -f &) | grep -q "Application startup complete" || true'
# Checking logs generated & startup of test-gateway-1
bash -c '(kubectl logs service/backend --context k3d-test-gateway-1 --namespace test-gateway-1 -f &) | grep -q "Application startup complete" || true'


# frontend
bash -c 'if [[ "$PYTEST_MODULES" == *"frontend"* ]]; then \
echo "Starting frontend"; date; \
Expand Down

0 comments on commit c8da625

Please sign in to comment.