Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OPCT-257: CI fix release/publish pipeline on GHA #114

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
148 changes: 148 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
---
name: unit

on:
workflow_call: {}

# golangci-lint-action requires those permissions to annotate issues in the PR.
permissions:
contents: read
pull-requests: read

env:
GO_VERSION: 1.22
GOLANGCI_LINT_VERSION: v1.59

jobs:
e2e-cmd_report:
name: "e2e-cmd_report"
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: opct-linux-amd64
path: /tmp/build/

- name: Running report
env:
BUCKET: openshift-provider-certification
REGION: us-west-2
OPCT_MODE: v0.4.0/default
EXEC_MODE: default
ARTIFACT: 4.15.0-20240228-HighlyAvailable-vsphere-None.tar.gz
OPCT: /tmp/build/opct-linux-amd64
run: |
URI=${OPCT_MODE}/${ARTIFACT}
URL=https://${BUCKET}.s3.${REGION}.amazonaws.com/${URI}

echo "> Downloading sample artifact: ${URL}"
wget -qO /tmp/result.tar.gz "${URL}"

echo "> Setting run permissions to OPCT:"
chmod u+x ${OPCT}

echo "> Running OPCT report:"
${OPCT} report /tmp/result.tar.gz

e2e-cmd_adm-parse-etcd-logs:
name: "e2e-cmd_adm-parse-etcd-logs"
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: opct-linux-amd64
path: /tmp/build/

- name: Preparing testdata
env:
BUCKET: openshift-provider-certification
REGION: us-west-2
VERSION: "testdata/must-gather-etcd-logs.tar.gz"
CUSTOM_BUILD_PATH: /tmp/build/opct-linux-amd64
LOCAL_TEST_DATA: /tmp/must-gather.tar.gz
LOCAL_TEST_DATA_DIR: /tmp/must-gather
run: |
URL=https://${BUCKET}.s3.${REGION}.amazonaws.com
echo "> Downloading sample artifact: ${URL}/${VERSION}"
wget -qO ${LOCAL_TEST_DATA} "${URL}/${VERSION}"

echo "> Setting run permissions to OPCT:"
chmod u+x ${CUSTOM_BUILD_PATH}

echo "> Extracting testdata:"
mkdir ${LOCAL_TEST_DATA_DIR}
tar xfz ${LOCAL_TEST_DATA} -C ${LOCAL_TEST_DATA_DIR}

- name: "e2e stdin reader: cat <etcd pod logs> | opct adm parse-etcd-logs"
env:
CUSTOM_BUILD_PATH: /tmp/build/opct-linux-amd64
TEST_DATA_DIR: /tmp/must-gather
NS_PATH_ETCD: namespaces/openshift-etcd/pods
LOG_PATH: etcd/etcd/logs
run: |
cat ${TEST_DATA_DIR}/*/*/${NS_PATH_ETCD}/*/${LOG_PATH}/*.log | \
${CUSTOM_BUILD_PATH} adm parse-etcd-logs

- name: "e2e must-gather dir: opct adm parse-etcd-logs <must-gather-dir>"
env:
CUSTOM_BUILD_PATH: /tmp/build/opct-linux-amd64
TEST_DATA_DIR: /tmp/must-gather
run: |
${CUSTOM_BUILD_PATH} adm parse-etcd-logs ${TEST_DATA_DIR}

- name: |
e2e aggregate by hour: opct adm parse-etcd-logs
--aggregator hour <must-gather-dir>
env:
OPCT: /tmp/build/opct-linux-amd64
TEST_DATA_DIR: /tmp/must-gather
run: |
${OPCT} adm parse-etcd-logs --aggregator hour ${TEST_DATA_DIR}

- name: |
e2e ignore error counters: opct adm parse-etcd-logs
--skip-error-counter=true <must-gather-dir>
env:
OPCT: /tmp/build/opct-linux-amd64
TEST_DATA_DIR: /tmp/must-gather
run: |
${OPCT} adm parse-etcd-logs \
--skip-error-counter=true ${TEST_DATA_DIR}

e2e-cmd_adm-parse-metrics:
name: "e2e-cmd_adm-parse-metrics"
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: opct-linux-amd64
path: /tmp/build/

- name: Preparing testdata
env:
BUCKET: openshift-provider-certification
REGION: us-west-2
PREFIX: testdata/ci-external-aws-ccm_
VERSION: 1757495441294888960-artifacts_must-gather-metrics.tar.xz
CUSTOM_BUILD_PATH: /tmp/build/opct-linux-amd64
LOCAL_TEST_DATA: /tmp/opct-metrics.tar.xz
run: |
DATA_VERSION=${PREFIX}${VERSION}
URL=https://${BUCKET}.s3.${REGION}.amazonaws.com
echo "> Downloading sample artifact: ${URL}/${DATA_VERSION}"
wget -qO ${LOCAL_TEST_DATA} "${URL}/${DATA_VERSION}"

echo "> Setting exec permissions to OPCT:"
chmod u+x ${CUSTOM_BUILD_PATH}

- name: "e2e parse metrics: opct adm parse-etcd-logs <must-gather-dir>"
env:
CUSTOM_BUILD_PATH: /tmp/build/opct-linux-amd64
LOCAL_TEST_DATA: /tmp/opct-metrics.tar.xz
run: |
${CUSTOM_BUILD_PATH} adm parse-metrics \
--input ${LOCAL_TEST_DATA} --output /tmp/metrics
tree /tmp/metrics
Loading
Loading