This is an automated email from the ASF dual-hosted git repository.

jason810496 pushed a commit to branch v3-4-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v3-4-test by this push:
     new 19469de1ebb [v3-4-test] Skip the Go SDK rule constants test outside 
the Airflow repository (#76888) (#76899)
19469de1ebb is described below

commit 19469de1ebbbf6e8e07a2c47a98bdf58efb7cdbf
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Thu Nov 12 15:55:37 2026 +0800

    [v3-4-test] Skip the Go SDK rule constants test outside the Airflow 
repository (#76888) (#76899)
    
    TestRuleConstantsMatchPython reads the trigger rule and weight rule enums
    from airflow-core, so `go test ./...` failed in the Go SDK source package,
    which ships go-sdk alone.
    (cherry picked from commit 5667fb5044b4ba0fe100c02aefc7ebd821930542)
    
    Co-authored-by: Jason(Zhe-You) Liu 
<[email protected]>
---
 go-sdk/airflow/enums_test.go | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/go-sdk/airflow/enums_test.go b/go-sdk/airflow/enums_test.go
index 32c8cd7fb09..764e8927f07 100644
--- a/go-sdk/airflow/enums_test.go
+++ b/go-sdk/airflow/enums_test.go
@@ -34,6 +34,10 @@ import (
 // enumsPath is the path, relative to this package, of the file that declares 
each enum.
 const enumsPath = "enums.go"
 
+// airflowCorePath is the path, relative to this package, of the airflow-core 
directory of the
+// Airflow repository.
+const airflowCorePath = "../../airflow-core"
+
 func readMatches(t *testing.T, path, pattern string) [][]string {
        t.Helper()
 
@@ -100,7 +104,13 @@ func toStrings[T ~string](values []T) []string {
 // checks. The test also compares triggerRules and weightRules with the Python 
enums.
 // checkTaskSpec accepts only the values in those lists, so an author cannot 
set a rule that the
 // lists leave out.
+//
+// The test skips outside the Airflow repository, such as in the SDK's source 
package, which has
+// no airflow-core directory.
 func TestRuleConstantsMatchPython(t *testing.T) {
+       if _, err := os.Stat(filepath.FromSlash(airflowCorePath)); 
os.IsNotExist(err) {
+               t.Skipf("%s not found: this test needs the Airflow repository", 
airflowCorePath)
+       }
        for _, tt := range []struct {
                goType     string
                pythonPath string
@@ -108,12 +118,12 @@ func TestRuleConstantsMatchPython(t *testing.T) {
        }{
                {
                        goType:     "TriggerRule",
-                       pythonPath: 
"../../airflow-core/src/airflow/task/trigger_rule.py",
+                       pythonPath: airflowCorePath + 
"/src/airflow/task/trigger_rule.py",
                        valid:      toStrings(triggerRules),
                },
                {
                        goType:     "WeightRule",
-                       pythonPath: 
"../../airflow-core/src/airflow/task/weight_rule.py",
+                       pythonPath: airflowCorePath + 
"/src/airflow/task/weight_rule.py",
                        valid:      toStrings(weightRules),
                },
        } {

Reply via email to