Skip to content

Commit

Permalink
Add GH action to run on pull request whenever there is focused check …
Browse files Browse the repository at this point in the history
…in the PR

Signed-off-by: Parthvi Vala <[email protected]>
  • Loading branch information
valaparthvi committed Feb 7, 2025
1 parent a45154a commit 3da5114
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 3 deletions.
22 changes: 22 additions & 0 deletions .github/scripts/focus-check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# Note: This script has been generated by Gemini AI.

# Get the absolute path to the repository root
repo_root=$(git rev-parse --show-toplevel)

# Define the absolute path to the hosted directory
hosted_dir="$repo_root/hosted"

# Use grep to search for the specified strings within .go files in the hosted directory
grep_result=$(grep -ErnI --include="*.go" -e "FIt" -e "FDescribe" -e "FContext" -e "FWhen" -e "FEntry" -e "FDescribeTable" "$hosted_dir")

# Check if any matches were found
if [[ -n "$grep_result" ]]; then
echo "Found focused tests (FIt, FDescribe, etc.) in the '$hosted_dir' directory:"
echo "$grep_result"
exit 1 # Exit with a non-zero status to indicate failure
else
echo "No focused tests found in the '$hosted_dir' directory."
exit 0 # Exit with a zero status to indicate success
fi
13 changes: 13 additions & 0 deletions .github/workflows/focus-ginkgo-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Checking for focused runs

on: [push]

jobs:
check-focus-target:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Running the focus check script
run: |
./focus-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var _ = Describe("K8sChartSupportUpgradeProvisioning", func() {
}
})

It("should successfully test k8s chart support provisioning in an upgrade scenario", func() {
FIt("should successfully test k8s chart support provisioning in an upgrade scenario", func() {
GinkgoLogr.Info(fmt.Sprintf("Testing K8s %s chart support for provisioning on Rancher upgraded from %s to %s", helpers.K8sUpgradedMinorVersion, helpers.RancherFullVersion, helpers.RancherUpgradeFullVersion))

testCaseID = 251 // Report to Qase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var _ = Describe("K8sChartSupportUpgradeImport", func() {
fmt.Println("Skipping downstream cluster deletion: ", clusterName)
}
})
It("should successfully test k8s chart support import in an upgrade scenario", func() {
FIt("should successfully test k8s chart support import in an upgrade scenario", func() {
GinkgoLogr.Info(fmt.Sprintf("Testing K8s %s chart support for import on Rancher upgraded from %s to %s", helpers.K8sUpgradedMinorVersion, helpers.RancherFullVersion, helpers.RancherUpgradeFullVersion))
testCaseID = 167 // Report to Qase

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/rancher/hosted-providers-e2e/hosted/helpers"
)

var _ = Describe("K8sChartSupportUpgradeProvisioning", func() {
var _ = FDescribe("K8sChartSupportUpgradeProvisioning", func() {

var (
cluster *management.Cluster
Expand Down

0 comments on commit 3da5114

Please sign in to comment.