MCPcopy Create free account
hub / github.com/devfile/api / GetRandomNumber

Function GetRandomNumber

test/v200/utils/common/test_utils.go:294–301  ·  view source on GitHub ↗

GetRandomNumber randomly returns an integer between 1 and the number specified.

(min int, max int)

Source from the content-addressed store, hash-verified

292
293// GetRandomNumber randomly returns an integer between 1 and the number specified.
294func GetRandomNumber(min int, max int) int {
295 if min == max {
296 return 1
297 } else if min > max {
298 return rand.Intn(max) + 1
299 }
300 return rand.Intn(max-min) + min + 1
301}
302
303// GetDevfile returns a structure used to represent a specific devfile in a test
304func GetDevfile(fileName string, follower DevfileFollower, validator DevfileValidator) (TestDevfile, error) {

Callers 15

getRandomExposureFunction · 0.85
getRandomProtocolFunction · 0.85
getUniquePortMethod · 0.85
CreateEndpointsMethod · 0.85
SetExecCommandValuesMethod · 0.85
GetRandomGroupKindFunction · 0.85
RunTestMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected