Skip to content

Pfcon version 1.0.0-alpha.1 #36

Pfcon version 1.0.0-alpha.1

Pfcon version 1.0.0-alpha.1 #36

Workflow file for this run

name: Integration tests
on:
pull_request:
branches: [ master ]
paths:
- '.github/workflows/test-chris.yml'
- 'charts/chris/**'
- 'charts/pfcon/**'
- 'testing/**'
jobs:
test:
name: Test chris
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
# N.B. `helm test` also tests subcharts for us
pfconEnabled: [ 'pfcon-enabled', 'pfcon-disabled' ]
steps:
- name: Git checkout
uses: actions/checkout@v4
- name: Set up Kubernetes with OpenObserve
uses: FNNDSC/kind-openobserve-action@v1
with:
openobserve_endpoint: ${{ secrets.OPENOBSERVE_URL }}/api/default/
openobserve_username: ${{ secrets.OPENOBSERVE_USERNAME }}
openobserve_password: ${{ secrets.OPENOBSERVE_PASSWORD }}
openobserve_stream: charts-chris-pfconEnabled-${{ matrix.pfconEnabled }}
kind_config: ./testing/kind-with-nodeport.yml
wait_until_ready: false
- name: Update Helm dependencies
run: helm dependency update ./charts/chris
- name: Install chris
run: |
if [ '${{ matrix.pfconEnabled }}' = 'pfcon-enabled' ]; then
pfconEnabled=true
else
pfconEnabled=false
fi
helm install --create-namespace -n ghactions khris-test ./charts/chris \
-f testing/ghactions-values.yml \
--set cube.ingress.nodePortHost=$(hostname) \
--set pfcon.enabled=$pfconEnabled
- name: Wait for server pod to be ready
run: kubectl wait --for=condition=ready pod -n ghactions -l app.kubernetes.io/name=chris-server --timeout=300s
- name: Assert superuser created
run: |
actual="$(kubectl logs -n ghactions -l app.kubernetes.io/name=chris-heart -c set-config)"
expected='Created superuser "khris"'
if [[ "$actual" != *"$expected"* ]]; then
echo "::error ::Expected: >>>$expected<<< Actual: >>>$actual<<<"
exit 1
fi
- name: Run helm test
run: |
set +ex
helm test -n ghactions khris-test
status=$?
if [ "$status" != '0' ]; then
echo "::warning ::First attempt failed, see https://github.com/FNNDSC/charts/issues/6"
echo "trying again..."
kubectl delete -n ghactions pod khris-test-test-cube-works
helm test -n ghactions khris-test
status=$?
fi
kubectl logs -n ghactions khris-test-test-cube-works
kubectl get pod -n ghactions
kubectl describe pod -n ghactions
kubectl exec -n ghactions $(kubectl get statefulset -n ghactions -l app.kubernetes.io/name=postgresql -o name) -i -- sh -c 'psql "postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@localhost:$POSTGRESQL_PORT_NUMBER/$POSTGRES_DATABASE"' <<< 'select * from plugininstances_plugininstance'
exit $status
- name: Test NodePort access
run: curl --fail-with-body http://localhost:32000/api/v1/
- name: Uninstall chart
run: helm uninstall --wait -n ghactions khris-test
- name: Delete namespace
run: kubectl delete namespace ghactions