-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Run e2e/integration test suites only by setting TEST_SUITE=xxx
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
- Loading branch information
1 parent
b090ba5
commit 1a18f11
Showing
8 changed files
with
106 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright (c) 2020 Cisco and/or its affiliates. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// 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 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// +build e2e | ||
|
||
package e2e | ||
|
||
import ( | ||
"go.ligato.io/vpp-agent/v3/tests/testutils" | ||
) | ||
|
||
func init() { | ||
testutils.SetTestSuite("e2e") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright (c) 2020 Cisco and/or its affiliates. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// 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 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// +build integration | ||
|
||
package vpp | ||
|
||
import ( | ||
testutils "go.ligato.io/vpp-agent/v3/tests/testutils" | ||
) | ||
|
||
func init() { | ||
testutils.SetTestSuite("integration") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright (c) 2020 Cisco and/or its affiliates. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// 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 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package testutils | ||
|
||
import ( | ||
"log" | ||
"os" | ||
"strings" | ||
) | ||
|
||
func TestSuite() string { | ||
return os.Getenv("TEST_SUITE") | ||
} | ||
|
||
func IsRunningTestSuite(suite string) bool { | ||
return strings.EqualFold(TestSuite(), suite) | ||
} | ||
|
||
func SetTestSuite(suite string) { | ||
if err := os.Setenv("TEST_SUITE", suite); err != nil { | ||
log.Panicf("error setting TEST_SUITE=%q: %v", suite, err) | ||
} | ||
} | ||
|
||
func RunTestSuite(suite string) bool { | ||
if !IsRunningTestSuite(suite) { | ||
log.Printf("skip running test suite: %[1]s (set TEST_SUITE=%[1]s to run)", suite) | ||
return false | ||
} | ||
return true | ||
} |