Skip to content

Commit

Permalink
Clean up of the coverage workflows and left over unused parts from re…
Browse files Browse the repository at this point in the history
…trieve changed files test targets utility
  • Loading branch information
Rd4dev committed Jul 25, 2024
1 parent f73037c commit fd1946e
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 193 deletions.
47 changes: 1 addition & 46 deletions .github/workflows/code_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,21 +166,6 @@ jobs:
echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV
echo "BAZEL_TEST_TARGETS=$BAZEL_TEST_TARGETS" >> $GITHUB_ENV
# - name: Extract test caching bucket & changed files test targets
# env:
# CHANGED_FILESS_BUCKET_BASE64_ENCODED_SHARD: ${{ matrix.changed-files-bucket-base64-encoded-shard }}
# run: |
# # See https://stackoverflow.com/a/29903172 for cut logic. This is needed to remove the
# # user-friendly shard prefix from the matrix value.
# CHANGED_FILES_TEST_TARGETS_BUCKET_BASE64=$(echo "$CHANGED_FILESS_BUCKET_BASE64_ENCODED_SHARD" | cut -d ";" -f 2)
# bazel run //scripts:retrieve_changed_files_test_targets -- $(pwd) $CHANGED_FILES_TEST_TARGETS_BUCKET_BASE64 $(pwd)/test_bucket_name $(pwd)/bazel_test_targets
# TEST_CATEGORY=$(cat ./test_bucket_name)
# BAZEL_TEST_TARGETS=$(cat ./bazel_test_targets)
# echo "Test category: $TEST_CATEGORY"
# echo "Bazel test targets: $BAZEL_TEST_TARGETS"
# echo "TEST_CACHING_BUCKET=$TEST_CATEGORY" >> $GITHUB_ENV
# echo "BAZEL_TEST_TARGETS=$BAZEL_TEST_TARGETS" >> $GITHUB_ENV

# For reference on this & the later cache actions, see:
# https://github.com/actions/cache/issues/239#issuecomment-606950711 &
# https://github.com/actions/cache/issues/109#issuecomment-558771281. Note that these work
Expand Down Expand Up @@ -307,44 +292,14 @@ jobs:
BAZEL_REMOTE_CACHE_URL: ${{ secrets.BAZEL_REMOTE_CACHE_URL }}
CHANGED_FILES: ${{ env.CHANGED_FILES }}
run: |
# Attempt to build 5 times in case there are flaky builds.
# TODO(#3970): Remove this once there are no longer app test build failures.
# i=0
# Disable exit-on-first-failure.
# set +e
# while [ $i -ne 5 ]; do
# i=$(( $i+1 ))
# echo "Attempt $i/5 to run test targets"
bazel run //scripts:run_coverage -- $(pwd) $CHANGED_FILES --format=MARKDOWN
# done
# Capture the error code of the final command run (which should be a success if there isn't a real build failure).
# last_error_code=$?
# Reenable exit-on-first-failure.
# set -e
# Exit only if the most recent exit was a failure (by using a subshell).
#(exit $last_error_code)
- name: Run Oppia Coverage (without caching, or on a fork)
if: ${{ env.ENABLE_CACHING == 'false' || ((github.ref != 'refs/heads/develop' || github.event_name != 'push') && (github.event.pull_request.head.repo.full_name != 'oppia/oppia-android')) }}
env:
BAZEL_TEST_TARGETS: ${{ env.BAZEL_TEST_TARGETS }}
CHANGED_FILES: ${{ env.CHANGED_FILES }}
run: |
# Attempt to build 5 times in case there are flaky builds.
# TODO(#3970): Remove this once there are no longer app test build failures.
# i=0
# Disable exit-on-first-failure.
# set +e
# while [ $i -ne 5 ]; do
# i=$(( $i+1 ))
# echo "Attempt $i/5 to run test targets"
bazel run //scripts:run_coverage -- $(pwd) $CHANGED_FILES --format=MARKDOWN
# done
# Capture the error code of the final command run (which should be a success if there isn't a real build failure).
# last_error_code=$?
# Reenable exit-on-first-failure.
# set -e
# Exit only if the most recent exit was a failure (by using a subshell).
#(exit $last_error_code)
# Reference: https://github.community/t/127354/7.
check_coverage_results:
Expand Down
8 changes: 0 additions & 8 deletions scripts/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -262,14 +262,6 @@ kt_jvm_binary(
runtime_deps = ["//scripts/src/java/org/oppia/android/scripts/ci:retrieve_changed_files_lib"],
)

#kt_jvm_binary(
# name = "retrieve_changed_files_test_targets",
# testonly = True,
# data = TEST_FILE_EXEMPTION_ASSETS,
# main_class = "org.oppia.android.scripts.ci.RetrieveChangedFilesTestTargetsKt",
# runtime_deps = ["//scripts/src/java/org/oppia/android/scripts/ci:retrieve_changed_files_test_targets_lib"],
#)

# Note that this is intentionally not test-only since it's used by the app build pipeline. Also,
# this apparently needs to be a java_binary to set up runfiles correctly when executed within a
# Starlark rule as a tool.
Expand Down
15 changes: 0 additions & 15 deletions scripts/src/java/org/oppia/android/scripts/ci/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,3 @@ kt_jvm_library(
"//scripts/src/java/org/oppia/android/scripts/proto:script_exemptions_java_proto",
],
)

#kt_jvm_library(
# name = "retrieve_changed_files_test_targets_lib",
# testonly = True,
# srcs = [
# "RetrieveChangedFilesTestTargets.kt",
# ],
# visibility = ["//scripts:oppia_script_binary_visibility"],
# deps = [
# "//scripts/src/java/org/oppia/android/scripts/common:bazel_client",
# "//scripts/src/java/org/oppia/android/scripts/common:proto_string_encoder",
# "//scripts/src/java/org/oppia/android/scripts/proto:changed_files_java_proto",
# "//scripts/src/java/org/oppia/android/scripts/proto:script_exemptions_java_proto",
# ],
#)

This file was deleted.

0 comments on commit fd1946e

Please sign in to comment.