Skip to content

Commit

Permalink
fix ordering of projects with parallel execution (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
fbad authored Jun 9, 2021
1 parent 84f4c4b commit e360212
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 4 additions & 0 deletions cmd/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cmd

import (
"regexp"
"sort"

log "github.com/sirupsen/logrus"

Expand Down Expand Up @@ -461,6 +462,9 @@ func main(cmd *cobra.Command, args []string) error {
return err
}

// Sort the projects in config by Dir
sort.Slice(config.Projects, func(i, j int) bool { return config.Projects[i].Dir < config.Projects[j].Dir })

// Convert config to YAML string
yamlBytes, err := yaml.Marshal(&config)
if err != nil {
Expand Down
3 changes: 0 additions & 3 deletions cmd/generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ func runTest(t *testing.T, goldenFile string, args []string) {
return
}

assert.ElementsMatch(t, content.Projects, goldenContents.Projects)
content.Projects = nil
goldenContents.Projects = nil
assert.Equal(t, content, goldenContents)
}

Expand Down

0 comments on commit e360212

Please sign in to comment.