Skip to content

Commit

Permalink
chore: run one e2e test
Browse files Browse the repository at this point in the history
Signed-off-by: Nikita Korolev <[email protected]>
  • Loading branch information
universal-itengineer committed Apr 17, 2024
1 parent 9cf80b9 commit f7e01a7
Showing 1 changed file with 55 additions and 9 deletions.
64 changes: 55 additions & 9 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: e2e

env:
CI_COMMIT_REF_NAME: ${{ github.ref_name }}
# E2E_CLUSTERTRANSPORT_TOKEN: ${{ secrets.E2E_VIRTUALIZATION_SA_TOKEN }}

on:
pull_request:
Expand All @@ -22,7 +23,7 @@ concurrency:
jobs:
show_dev_manifest:
runs-on: ubuntu-latest
name: Show manifest
name: Run e2e
steps:
- name: Install Task
uses: arduino/setup-task@v2
Expand All @@ -38,13 +39,58 @@ jobs:
method: service-account
k8s-url: https://api.e2e.virtlab.flant.com
k8s-secret: ${{ secrets.E2E_VIRTUALIZATION_SA_SECRET }}
# token: ${{ secrets.E2E_VIRTUALIZATION_SA_TOKEN }}

- name: Create Namespace
- name: e2e
run: |
kubectl create namespace testgh
- name: Get ns and delete
run: |
kubectl get ns | grep testgh
kubectl delete namespace testgh
export E2E_NAMESPACE=pr${{github.event.pull_request.number}}-test
export E2E_CLUSTERTRANSPORT_KUBECONFIG=$KUBECONFIG
export CLUSTER_NAME=default
export E2E_CLUSTERTRANSPORT_ENDPOINT=$(kubectl config view -o jsonpath="{.clusters[?(@.name==\"$CLUSTER_NAME\")].cluster.server}")
export E2E_CLUSTERTRANSPORT_TOKEN=$(kubectl get secret github-virtualization-e2e-token -n d8-service-accounts -ojsonpath='{.data.token}' | base64 -d)
echo "${{ secrets.E2E_VIRTUALIZATION_SA_SECRET }}" | yq e '.data."ca.crt"' | base64 -d > ca.crt
export E2E_CLUSTERTRANSPORT_CERTIFICATEAUTHORITY="$PWD/ca.crt"
echo "show context"
kubectl config get-contexts
echo "--"
echo "Show KUBECONFIG env"
echo $KUBECONFIG
echo "--"
echo " "
echo "Get NS"
kubectl get ns
task e2e:run_one TEST="Label and Annotation"
# run: |
# kubectl config view -o jsonpath='{"Cluster name\tServer\n"}{range .clusters[*]}{.name}{"\t"}{.cluster.server}{"\n"}{end}'

# export E2E_CLUSTERTRANSPORT_ENDPOINT="https://api.e2e.virtlab.flant.com"
# export CLUSTER_NAME="e2e-cluster"
# export E2E_CLUSTERTRANSPORT_ENDPOINT=$(kubectl config view -o jsonpath="{.clusters[?(@.name==\"$CLUSTER_NAME\")].cluster.server}")
# export E2E_CLUSTERTRANSPORT_TOKEN=$(echo ${{ secrets.E2E_VIRTUALIZATION_SA_TOKEN }})

# export E2E_CLUSTERTRANSPORT_TOKEN=$(echo ${{ secrets.E2E_VIRTUALIZATION_SA_SECRET }} | yq '.data.token' | base64 -d)

# echo ${{ secrets.E2E_VIRTUALIZATION_SA_SECRET }} | yq e '.data."ca.crt"' | base64 -d > ca.crt
# export E2E_CLUSTERTRANSPORT_CERTIFICATEAUTHORITY="$PWD/ca.crt"

# export E2E_CLUSTERTRANSPORT_INSECURETLS="true"

# task e2e:run_one TEST="Label and Annotation"



# - name: Create Namespace
# run: |
# kubectl create namespace testgh

# - name: Get ns and delete
# run: |
# kubectl get ns | grep testgh
# kubectl delete namespace testgh

0 comments on commit f7e01a7

Please sign in to comment.