Skip to content

Migrate to poetry for dep management. #19

Migrate to poetry for dep management.

Migrate to poetry for dep management. #19

Workflow file for this run

name: E2E Tests
on:
pull_request:
branches:
- '*'
jobs:
test:
runs-on:
- banzai-runner
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install kubectl
uses: azure/setup-kubectl@v3
with:
version: "v1.22.17"
- name: Start a Kind cluster
uses: helm/kind-action@v1.8.0
with:
cluster_name: kind
version: "v0.19.0"
node_image: kindest/node:v1.22.17@sha256:9af784f45a584f6b28bce2af84c494d947a05bd709151466489008f80a9ce9d5
wait: "600s"
- name: Build docker image
run: |
docker build -t banzai-nres:test-latest .
- name: Copy docker image to nodes
run: |
kind load docker-image banzai-nres:test-latest
- name: Start banzai
run: |
# Deploy banzai stack
kubectl create secret generic auth-token-secret --from-literal=auth-token=${{ secrets.ArchiveAuthToken }}
kubectl apply -k banzai_nres/tests/k8s
POD=$(kubectl get pod -l app.kubernetes.io/name=banzai-nres-e2e -o jsonpath="{.items[0].metadata.name}")
echo "POD=${POD}" >> $GITHUB_ENV
# Wait for banzai to be ready
kubectl wait --for=condition=Ready --timeout=60m pod/${POD}
- name: Test Bias Subtraction
run: |
set +e
export START=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
kubectl exec $POD -c banzai-nres-e2e-listener -- pytest -s --pyargs banzai_nres --durations=0 -m master_bias
EXIT_CODE=$?
# Always print logs even if (especially if?) the reduction fails
kubectl logs $POD -c banzai-nres-e2e-listener --since-time=$START --prefix=true
kubectl logs $POD -c banzai-nres-e2e-celery-workers --since-time=$START --prefix=true
# Exit with the captured status so the job properly fails or succeeds
exit $EXIT_CODE
- name: Test Dark Subtraction
run: |
set +e
export START=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
kubectl exec $POD -c banzai-nres-e2e-listener -- pytest -s --pyargs banzai_nres --durations=0 -m master_dark
EXIT_CODE=$?
# Always print logs even if (especially if?) the reduction fails
kubectl logs $POD -c banzai-nres-e2e-listener --since-time=$START --prefix=true
kubectl logs $POD -c banzai-nres-e2e-celery-workers --since-time=$START --prefix=true
# Exit with the captured status so the job properly fails or succeeds
exit $EXIT_CODE
- name: Test Flat Fielding
run: |
set +e
export START=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
kubectl exec $POD -c banzai-nres-e2e-listener -- pytest -s --pyargs banzai_nres --durations=0 -m master_flat
EXIT_CODE=$?
# Always print logs even if (especially if?) the reduction fails
kubectl logs $POD -c banzai-nres-e2e-listener --since-time=$START --prefix=true
kubectl logs $POD -c banzai-nres-e2e-celery-workers --since-time=$START --prefix=true
# Exit with the captured status so the job properly fails or succeeds
exit $EXIT_CODE
- name: Test Arc Frames
run: |
set +e
export START=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
kubectl exec $POD -c banzai-nres-e2e-listener -- pytest -s --pyargs banzai_nres --durations=0 -m master_arc
EXIT_CODE=$?
# Always print logs even if (especially if?) the reduction fails
kubectl logs $POD -c banzai-nres-e2e-listener --since-time=$START --prefix=true
kubectl logs $POD -c banzai-nres-e2e-celery-workers --since-time=$START --prefix=true
# Exit with the captured status so the job properly fails or succeeds
exit $EXIT_CODE
- name: Test Science Frame Creation
run: |
set +e
export START=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
kubectl exec $POD -c banzai-nres-e2e-listener -- pytest -s --pyargs banzai_nres --durations=0 -m science_frames
EXIT_CODE=$?
# Always print logs even if (especially if?) the reduction fails
kubectl logs $POD -c banzai-nres-e2e-listener --since-time=$START --prefix=true
kubectl logs $POD -c banzai-nres-e2e-celery-workers --since-time=$START --prefix=true
# Exit with the captured status so the job properly fails or succeeds
exit $EXIT_CODE
- name: Cleanup
run: |
kubectl delete deployment banzai-nres-e2e