mirror of
https://github.com/googleforgames/open-match.git
synced 2025-03-25 13:24:18 +00:00
Reorder make rule dependencies to fix presubmit (#822)
This commit is contained in:
2
Makefile
2
Makefile
@ -882,7 +882,7 @@ ci-reap-namespaces: build/toolchain/bin/reaper$(EXE_EXTENSION)
|
||||
|
||||
# For presubmit we want to update the protobuf generated files and verify that tests are good.
|
||||
presubmit: GOLANG_TEST_COUNT = 5
|
||||
presubmit: clean update-deps third_party/ assets lint build install-toolchain test md-test terraform-test
|
||||
presubmit: clean third_party/ assets update-deps lint build install-toolchain test md-test terraform-test
|
||||
|
||||
build/release/: presubmit clean-install-yaml install/yaml/
|
||||
mkdir -p $(BUILD_DIR)/release/
|
||||
|
@ -22,25 +22,25 @@ import (
|
||||
)
|
||||
|
||||
// multifilterProfiles generates a multiple profiles, each containing a single Pool
|
||||
// that specifies multiple filters to pick a partitioned player population. Note
|
||||
// that specifies multiple filters to pick a partitioned player population. Note
|
||||
// that across all the profiles returned, the entire population is covered and given
|
||||
// the overlapping nature of filters, multiple profiles returned by this method may
|
||||
// match to the same set of players.
|
||||
func multifilterProfiles(cfg config.View) []*pb.MatchProfile {
|
||||
regions := cfg.GetStringSlice("testConfig.regions")
|
||||
ratingFilters := makeRangeFilters(&rangeConfig{
|
||||
name: "Rating",
|
||||
min: cfg.GetInt("testConfig.minRating"),
|
||||
max: cfg.GetInt("testConfig.maxRating"),
|
||||
rangeSize: cfg.GetInt("testConfig.multifilter.rangeSize"),
|
||||
name: "Rating",
|
||||
min: cfg.GetInt("testConfig.minRating"),
|
||||
max: cfg.GetInt("testConfig.maxRating"),
|
||||
rangeSize: cfg.GetInt("testConfig.multifilter.rangeSize"),
|
||||
rangeOverlap: cfg.GetInt("testConfig.multifilter.rangeOverlap"),
|
||||
})
|
||||
|
||||
latencyFilters := makeRangeFilters(&rangeConfig{
|
||||
name: "Latency",
|
||||
min: 0,
|
||||
max: 100,
|
||||
rangeSize: 70,
|
||||
name: "Latency",
|
||||
min: 0,
|
||||
max: 100,
|
||||
rangeSize: 70,
|
||||
rangeOverlap: 0,
|
||||
})
|
||||
|
||||
|
@ -29,18 +29,18 @@ func multipoolProfiles(cfg config.View) []*pb.MatchProfile {
|
||||
characters := cfg.GetStringSlice("testConfig.characters")
|
||||
regions := cfg.GetStringSlice("testConfig.regions")
|
||||
ratingFilters := makeRangeFilters(&rangeConfig{
|
||||
name: "Rating",
|
||||
min: cfg.GetInt("testConfig.minRating"),
|
||||
max: cfg.GetInt("testConfig.maxRating"),
|
||||
rangeSize: cfg.GetInt("testConfig.multipool.rangeSize"),
|
||||
name: "Rating",
|
||||
min: cfg.GetInt("testConfig.minRating"),
|
||||
max: cfg.GetInt("testConfig.maxRating"),
|
||||
rangeSize: cfg.GetInt("testConfig.multipool.rangeSize"),
|
||||
rangeOverlap: cfg.GetInt("testConfig.multipool.rangeOverlap"),
|
||||
})
|
||||
|
||||
latencyFilters := makeRangeFilters(&rangeConfig{
|
||||
name: "Latency",
|
||||
min: 0,
|
||||
max: 100,
|
||||
rangeSize: 70,
|
||||
name: "Latency",
|
||||
min: 0,
|
||||
max: 100,
|
||||
rangeSize: 70,
|
||||
rangeOverlap: 0,
|
||||
})
|
||||
|
||||
|
@ -34,7 +34,7 @@ type rangeConfig struct {
|
||||
rangeOverlap int
|
||||
}
|
||||
|
||||
// makeRosterSlots generates a roster with the specified name and with the
|
||||
// makeRosterSlots generates a roster with the specified name and with the
|
||||
// specified number of empty roster slots.
|
||||
func makeRosterSlots(name string, count int) *pb.Roster {
|
||||
roster := &pb.Roster{
|
||||
@ -48,13 +48,13 @@ func makeRosterSlots(name string, count int) *pb.Roster {
|
||||
return roster
|
||||
}
|
||||
|
||||
// makeRangeFilters generates multiple filters over a given range based on
|
||||
// makeRangeFilters generates multiple filters over a given range based on
|
||||
// the size of the range and the overlap specified for the filters.
|
||||
func makeRangeFilters(config *rangeConfig) []*rangeFilter {
|
||||
var filters []*rangeFilter
|
||||
r := config.min
|
||||
for r <= config.max {
|
||||
max := r+config.rangeSize
|
||||
max := r + config.rangeSize
|
||||
if max > config.max {
|
||||
r = config.max
|
||||
}
|
||||
@ -64,9 +64,9 @@ func makeRangeFilters(config *rangeConfig) []*rangeFilter {
|
||||
min: r,
|
||||
max: max,
|
||||
})
|
||||
|
||||
|
||||
r = r + 1 + (config.rangeSize - config.rangeOverlap)
|
||||
}
|
||||
|
||||
return filters
|
||||
}
|
||||
}
|
||||
|
@ -36,12 +36,12 @@ var (
|
||||
func Ticket(cfg config.View) *pb.Ticket {
|
||||
characters := cfg.GetStringSlice("testConfig.characters")
|
||||
regions := cfg.GetStringSlice("testConfig.regions")
|
||||
min:= cfg.GetFloat64("testConfig.minRating")
|
||||
max:= cfg.GetFloat64("testConfig.maxRating")
|
||||
min := cfg.GetFloat64("testConfig.minRating")
|
||||
max := cfg.GetFloat64("testConfig.maxRating")
|
||||
latencyMap := latency(regions)
|
||||
ticket := &pb.Ticket{
|
||||
Properties: structs.Struct{
|
||||
"mmr.rating": structs.Number(normalDist(40, min, max, 20)),
|
||||
"mmr.rating": structs.Number(normalDist(40, min, max, 20)),
|
||||
// TODO: Use string attribute value for the character attribute.
|
||||
characters[rand.Intn(len(characters))]: structs.Number(float64(time.Now().Unix())),
|
||||
}.S(),
|
||||
@ -53,7 +53,8 @@ func Ticket(cfg config.View) *pb.Ticket {
|
||||
|
||||
return ticket
|
||||
}
|
||||
// latency generates a latency mapping of each region to a latency value. It picks
|
||||
|
||||
// latency generates a latency mapping of each region to a latency value. It picks
|
||||
// one region with latency between 0ms to 100ms and sets latencies to all other regions
|
||||
// to a value between 100ms to 300ms.
|
||||
func latency(regions []string) map[string]float64 {
|
||||
|
@ -120,7 +120,7 @@ func TestExtractIndexFilters(t *testing.T) {
|
||||
description: "range",
|
||||
pool: &pb.Pool{
|
||||
FloatRangeFilters: []*pb.FloatRangeFilter{
|
||||
&pb.FloatRangeFilter{
|
||||
{
|
||||
Attribute: "foo",
|
||||
Min: -1,
|
||||
Max: 1,
|
||||
@ -139,7 +139,7 @@ func TestExtractIndexFilters(t *testing.T) {
|
||||
description: "bool false",
|
||||
pool: &pb.Pool{
|
||||
BoolEqualsFilters: []*pb.BoolEqualsFilter{
|
||||
&pb.BoolEqualsFilter{
|
||||
{
|
||||
Attribute: "foo",
|
||||
Value: false,
|
||||
},
|
||||
@ -157,7 +157,7 @@ func TestExtractIndexFilters(t *testing.T) {
|
||||
description: "bool true",
|
||||
pool: &pb.Pool{
|
||||
BoolEqualsFilters: []*pb.BoolEqualsFilter{
|
||||
&pb.BoolEqualsFilter{
|
||||
{
|
||||
Attribute: "foo",
|
||||
Value: true,
|
||||
},
|
||||
@ -175,7 +175,7 @@ func TestExtractIndexFilters(t *testing.T) {
|
||||
description: "string equals",
|
||||
pool: &pb.Pool{
|
||||
StringEqualsFilters: []*pb.StringEqualsFilter{
|
||||
&pb.StringEqualsFilter{
|
||||
{
|
||||
Attribute: "foo",
|
||||
Value: "bar",
|
||||
},
|
||||
|
Reference in New Issue
Block a user