-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merging to release-5.2: [TT-10531] improve plugin tests area (#5777)
[TT-10531] improve plugin tests area (#5777) PR does the following: - compiles a plugin with and without race - adds test.IsRaceEnabled - fixes goplugin tests to load appropriate plugin https://tyktech.atlassian.net/browse/TT-10531 --------- Co-authored-by: Tit Petric <tit@tyk.io>
- Loading branch information
Showing
5 changed files
with
61 additions
and
26 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
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,8 @@ | ||
//go:build !race | ||
// +build !race | ||
|
||
package test | ||
|
||
func IsRaceEnabled() bool { | ||
return false | ||
} |
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,8 @@ | ||
//go:build race | ||
// +build race | ||
|
||
package test | ||
|
||
func IsRaceEnabled() bool { | ||
return true | ||
} |
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,11 @@ | ||
package test | ||
|
||
import "testing" | ||
|
||
func TestIsRaceEnabled(t *testing.T) { | ||
if enabled := IsRaceEnabled(); enabled { | ||
t.Log("Flag -race passed") | ||
} else { | ||
t.Log("Flag -race omitted") | ||
} | ||
} |