Skip to content

Commit

Permalink
fix: Skip dangerous tests while not in CI (aliyun#569)
Browse files Browse the repository at this point in the history
* fix: Disable dangerous tests for now

Signed-off-by: Xuanwo <[email protected]>
  • Loading branch information
Xuanwo authored Dec 6, 2022
1 parent 550ccb6 commit f967561
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
8 changes: 7 additions & 1 deletion cli/completion_installer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down Expand Up @@ -75,6 +75,11 @@ func TestZshInstaller(t *testing.T) {
}

func TestCompletionInstallers(t *testing.T) {
// Check if we are in CI env.
if _, ok := os.LookupEnv("CI"); !ok {
t.SkipNow()
}

i := completionInstallers()
if runtime.GOOS == "windows" {
assert.Empty(t, i)
Expand All @@ -99,6 +104,7 @@ func TestCompletionInstallers(t *testing.T) {
os.Remove(path)
os.Remove(path2)
}

func TestCompletion(t *testing.T) {
w := new(bytes.Buffer)
stderr := new(bytes.Buffer)
Expand Down
7 changes: 6 additions & 1 deletion cli/completion_utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down Expand Up @@ -108,6 +108,11 @@ func TestCopyFile(t *testing.T) {
}

func TestFishConfigDir(t *testing.T) {
// Check if we are in CI env.
if _, ok := os.LookupEnv("CI"); !ok {
t.SkipNow()
}

u := getConfigHomePath()
assert.NotNil(t, u)

Expand Down

0 comments on commit f967561

Please sign in to comment.