-
Notifications
You must be signed in to change notification settings - Fork 479
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable code coverage for system tests (#970)
This commit adds possibility to build kiali which can produce code coverage report even for system tests which run against kiali deployed in OpenShift. Note this does not do anything for code coverage of unit tests.
- Loading branch information
1 parent
d6614ea
commit e3772de
Showing
2 changed files
with
25 additions
and
0 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
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,20 @@ | ||
package main | ||
|
||
// This file is mandatory as otherwise the kiali binary for system tests is not generated correctly. | ||
import ( | ||
"flag" | ||
"testing" | ||
) | ||
|
||
var systemTest *bool | ||
|
||
func init() { | ||
systemTest = flag.Bool("systemTest", false, "Set to true when running system tests") | ||
} | ||
|
||
// Test started when the test binary is started. Only calls main. | ||
func TestSystem(t *testing.T) { | ||
if *systemTest { | ||
main() | ||
} | ||
} |