Skip to content

Commit

Permalink
deprecate suite list gather in artifacts collector; stream from plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
mtulio committed Aug 5, 2024
1 parent 08bb69b commit c534995
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 32 deletions.
48 changes: 24 additions & 24 deletions .github/workflows/pre_test-openshift-tests-plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,27 +94,27 @@ jobs:
name: openshift-tests-plugin
path: openshift-tests-plugin/openshift-tests-plugin

# build-image:
# runs-on: ubuntu-latest
# needs: [build-binary]
# steps:
# - name: Checkout
# uses: actions/checkout@v4

# - uses: actions/setup-go@v5
# with:
# go-version-file: openshift-tests-plugin/go.mod
# cache-dependency-path: |
# openshift-tests-plugin/go.sum

# - name: Install dependencies
# run: |
# sudo apt-get update
# sudo apt-get install -y make git

# - name: Build Binary (OS=linux/amd64)
# env:
# OS_ARCH: linux/amd64
# SKIP_ANNOTATION: "true"
# run: |
# make build COMMAND=build PLATFORMS=${OS_ARCH}
# build-image:
# runs-on: ubuntu-latest
# needs: [build-binary]
# steps:
# - name: Checkout
# uses: actions/checkout@v4

# - uses: actions/setup-go@v5
# with:
# go-version-file: openshift-tests-plugin/go.mod
# cache-dependency-path: |
# openshift-tests-plugin/go.sum

# - name: Install dependencies
# run: |
# sudo apt-get update
# sudo apt-get install -y make git

# - name: Build Binary (OS=linux/amd64)
# env:
# OS_ARCH: linux/amd64
# SKIP_ANNOTATION: "true"
# run: |
# make build COMMAND=build PLATFORMS=${OS_ARCH}
13 changes: 7 additions & 6 deletions artifacts-collector/collector.sh
Original file line number Diff line number Diff line change
Expand Up @@ -201,17 +201,18 @@ run_plugin_collector() {
send_test_progress "status=running=collecting metrics";
collect_metrics || true

# DEPRECATING: as it is streamed by the openshift-tests-plugin, tests container.
# Collecting e2e list for Kubernetes Conformance
send_test_progress "status=running=collecting e2e=${OPENSHIFT_TESTS_SUITE_KUBE_CONFORMANCE}";
collect_tests_conformance "${OPENSHIFT_TESTS_SUITE_KUBE_CONFORMANCE}" "./artifacts_e2e-tests_kubernetes-conformance.txt" || true
#send_test_progress "status=running=collecting e2e=${OPENSHIFT_TESTS_SUITE_KUBE_CONFORMANCE}";
#collect_tests_conformance "${OPENSHIFT_TESTS_SUITE_KUBE_CONFORMANCE}" "./artifacts_e2e-tests_kubernetes-conformance.txt" || true

# Collecting e2e list for OpenShift Conformance
send_test_progress "status=running=collecting e2e=${OPENSHIFT_TESTS_SUITE_OPENSHIFT_CONFORMANCE}";
collect_tests_conformance "${OPENSHIFT_TESTS_SUITE_OPENSHIFT_CONFORMANCE}" "./artifacts_e2e-tests_openshift-conformance.txt" || true
#send_test_progress "status=running=collecting e2e=${OPENSHIFT_TESTS_SUITE_OPENSHIFT_CONFORMANCE}";
#collect_tests_conformance "${OPENSHIFT_TESTS_SUITE_OPENSHIFT_CONFORMANCE}" "./artifacts_e2e-tests_openshift-conformance.txt" || true

# Collecting e2e list for OpenShift Upgrade (when mode=upgrade)
send_test_progress "status=running=collecting e2e=upgrade";
collect_tests_upgrade || true
#send_test_progress "status=running=collecting e2e=upgrade";
#collect_tests_upgrade || true

# Creating Result file used to publish to sonobuoy. (last step)
send_test_progress "status=running=saving artifacts";
Expand Down
14 changes: 12 additions & 2 deletions openshift-tests-plugin/plugin/entrypoint-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,24 @@ do
echo "$(date) ${msg}";
sleep 10;
done
echo -e "\n\n\t>> Copying e2e artifact to collector plugin..."
echo -e "\n\n\t>> Copying e2e artifacts to collector plugin..."
{
echo -e ">> Discoverying artifacts pod..."
COLLECTOR_POD=$(oc get pods -n opct -l sonobuoy-plugin=99-openshift-artifacts-collector -o jsonpath='{.items[*].metadata.name}')

suite_file="artifacts_e2e-tests_${PLUGIN_NAME-}.txt"
echo -e ">> Copying e2e suite list metadata..."
oc cp -c plugin "${CTRL_SUITE_LIST}" "opct/$COLLECTOR_POD":"/tmp/sonobuoy/results/${suite_file}" || true

echo -e ">> Preparing e2e metatada..."
# must prefix with artifacts_
e2e_artifact_name="artifacts_e2e-metadata-${PLUGIN_NAME:-}.tar.gz"
e2e_artifact="/tmp/${e2e_artifact_name}"
tar cfzv "${e2e_artifact}" /tmp/shared/junit/* || true
oc cp -c plugin "${e2e_artifact}" "opct/$COLLECTOR_POD":"/tmp/sonobuoy/results/${e2e_artifact_name}"

echo -e ">> Copying e2e metadata ${e2e_artifact_name}..."
oc cp -c plugin "${e2e_artifact}" opct/"${COLLECTOR_POD}":/tmp/sonobuoy/results/"${e2e_artifact_name}" || true

} || true
touch ${CTRL_DONE_TESTS}

Expand Down

0 comments on commit c534995

Please sign in to comment.