Skip to content

Commit

Permalink
Disable jet command test on CICD
Browse files Browse the repository at this point in the history
  • Loading branch information
safaci2000 committed Oct 3, 2024
1 parent 9b11b3b commit f62a19a
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

env:
TEST_RESULTS: /tmp/test-results # path to where test results will be saved
GH_ACTIONS: "1"


jobs:
Expand Down
11 changes: 11 additions & 0 deletions tests/internal/utils/common/const.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package common

import "os"

const (
GhActions = "GH_ACTIONS"
)

func IsCICDTest() bool {
return os.Getenv(GhActions) == "1"
}
7 changes: 7 additions & 0 deletions tests/mysql/generator_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package mysql

import (
"github.com/go-jet/jet/v2/tests/internal/utils/common"
"os"
"os/exec"
"strconv"
Expand Down Expand Up @@ -75,6 +76,9 @@ func TestGenerator_TableMetadata(t *testing.T) {
}

func TestCmdGenerator(t *testing.T) {
if common.IsCICDTest() {
t.SkipNow()
}
err := os.RemoveAll(genTestDir3)
require.NoError(t, err)

Expand Down Expand Up @@ -123,6 +127,9 @@ func TestCmdGenerator(t *testing.T) {
}

func TestIgnoreTablesViewsEnums(t *testing.T) {
if common.IsCICDTest() {
t.SkipNow()
}
tests := []struct {
name string
args []string
Expand Down
7 changes: 7 additions & 0 deletions tests/postgres/generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package postgres

import (
"fmt"
"github.com/go-jet/jet/v2/tests/internal/utils/common"
"os"
"os/exec"
"path/filepath"
Expand Down Expand Up @@ -84,6 +85,9 @@ func getEnvironmentPort() string {

func TestCmdGenerator(t *testing.T) {
skipForCockroachDB(t)
if common.IsCICDTest() {
t.SkipNow()
}
err := os.RemoveAll(genTestDir2)
require.NoError(t, err)

Expand Down Expand Up @@ -120,6 +124,9 @@ func TestCmdGenerator(t *testing.T) {
}

func TestGeneratorIgnoreTables(t *testing.T) {
if common.IsCICDTest() {
t.SkipNow()
}
skipForCockroachDB(t)
tests := []struct {
name string
Expand Down
7 changes: 7 additions & 0 deletions tests/sqlite/generator_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package sqlite

import (
"github.com/go-jet/jet/v2/tests/internal/utils/common"
"os"
"os/exec"
"reflect"
Expand Down Expand Up @@ -92,6 +93,9 @@ func TestGenerator_TableMetadata(t *testing.T) {
}

func TestCmdGenerator(t *testing.T) {
if common.IsCICDTest() {
t.SkipNow()
}
cmd := exec.Command("jet", "-source=SQLite", "-dsn=file://"+testDatabaseFilePath, "-path="+genDestDir)

cmd.Stderr = os.Stderr
Expand All @@ -107,6 +111,9 @@ func TestCmdGenerator(t *testing.T) {
}

func TestCmdGeneratorIgnoreTablesViewsEnums(t *testing.T) {
if common.IsCICDTest() {
t.SkipNow()
}
cmd := exec.Command("jet",
"-source=SQLite",
"-dsn=file://"+testDatabaseFilePath,
Expand Down

0 comments on commit f62a19a

Please sign in to comment.