-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove msc build tags. Add msc packages. (#666)
* Remove msc build tags. Add msc packages. This adds more parallelism as a side-effect. * Remove msc2836 as known broken
- Loading branch information
Showing
14 changed files
with
156 additions
and
23 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,41 @@ | ||
package helpers | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
"testing" | ||
|
||
"github.com/matrix-org/complement/b" | ||
"github.com/matrix-org/complement/internal/docker" | ||
) | ||
|
||
var testPackage *TestPackage | ||
|
||
// TestMain is the main entry point for Complement. | ||
// | ||
// It will clean up any old containers/images/networks from the previous run, then run the tests, then clean up | ||
// again. No blueprints are made at this point as they are lazily made on demand. | ||
// | ||
// The 'namespace' should be unique for this test package, among all test packages which may run in parallel, to avoid | ||
// docker containers stepping on each other. For MSCs, use the MSC name. For versioned releases, use the version number | ||
// along with any sub-directory name. | ||
func TestMain(m *testing.M, namespace string) { | ||
var err error | ||
testPackage, err = NewTestPackage(namespace) | ||
if err != nil { | ||
fmt.Printf("Error: %s", err) | ||
os.Exit(1) | ||
} | ||
exitCode := m.Run() | ||
testPackage.Cleanup() | ||
os.Exit(exitCode) | ||
} | ||
|
||
// Deploy will deploy the given blueprint or terminate the test. | ||
// It will construct the blueprint if it doesn't already exist in the docker image cache. | ||
// This function is the main setup function for all tests as it provides a deployment with | ||
// which tests can interact with. | ||
func Deploy(t *testing.T, blueprint b.Blueprint) *docker.Deployment { | ||
t.Helper() | ||
return testPackage.Deploy(t, blueprint) | ||
} |
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,18 @@ | ||
package tests | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/matrix-org/complement/b" | ||
"github.com/matrix-org/complement/helpers" | ||
"github.com/matrix-org/complement/internal/docker" | ||
) | ||
|
||
func TestMain(m *testing.M) { | ||
helpers.TestMain(m, "msc2836") | ||
} | ||
|
||
func Deploy(t *testing.T, blueprint b.Blueprint) *docker.Deployment { | ||
t.Helper() | ||
return helpers.Deploy(t, blueprint) | ||
} |
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 |
---|---|---|
@@ -1,6 +1,3 @@ | ||
//go:build msc2836 | ||
// +build msc2836 | ||
|
||
package tests | ||
|
||
import ( | ||
|
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,18 @@ | ||
package tests | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/matrix-org/complement/b" | ||
"github.com/matrix-org/complement/helpers" | ||
"github.com/matrix-org/complement/internal/docker" | ||
) | ||
|
||
func TestMain(m *testing.M) { | ||
helpers.TestMain(m, "msc3391") | ||
} | ||
|
||
func Deploy(t *testing.T, blueprint b.Blueprint) *docker.Deployment { | ||
t.Helper() | ||
return helpers.Deploy(t, blueprint) | ||
} |
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,18 @@ | ||
package tests | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/matrix-org/complement/b" | ||
"github.com/matrix-org/complement/helpers" | ||
"github.com/matrix-org/complement/internal/docker" | ||
) | ||
|
||
func TestMain(m *testing.M) { | ||
helpers.TestMain(m, "msc3874") | ||
} | ||
|
||
func Deploy(t *testing.T, blueprint b.Blueprint) *docker.Deployment { | ||
t.Helper() | ||
return helpers.Deploy(t, blueprint) | ||
} |
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,18 @@ | ||
package tests | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/matrix-org/complement/b" | ||
"github.com/matrix-org/complement/helpers" | ||
"github.com/matrix-org/complement/internal/docker" | ||
) | ||
|
||
func TestMain(m *testing.M) { | ||
helpers.TestMain(m, "msc3890") | ||
} | ||
|
||
func Deploy(t *testing.T, blueprint b.Blueprint) *docker.Deployment { | ||
t.Helper() | ||
return helpers.Deploy(t, blueprint) | ||
} |
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
5 changes: 1 addition & 4 deletions
5
...ederation_room_join_partial_state_test.go → ...ederation_room_join_partial_state_test.go
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,18 @@ | ||
package tests | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/matrix-org/complement/b" | ||
"github.com/matrix-org/complement/helpers" | ||
"github.com/matrix-org/complement/internal/docker" | ||
) | ||
|
||
func TestMain(m *testing.M) { | ||
helpers.TestMain(m, "msc3902") | ||
} | ||
|
||
func Deploy(t *testing.T, blueprint b.Blueprint) *docker.Deployment { | ||
t.Helper() | ||
return helpers.Deploy(t, blueprint) | ||
} |
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,18 @@ | ||
package tests | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/matrix-org/complement/b" | ||
"github.com/matrix-org/complement/helpers" | ||
"github.com/matrix-org/complement/internal/docker" | ||
) | ||
|
||
func TestMain(m *testing.M) { | ||
helpers.TestMain(m, "msc3930") | ||
} | ||
|
||
func Deploy(t *testing.T, blueprint b.Blueprint) *docker.Deployment { | ||
t.Helper() | ||
return helpers.Deploy(t, blueprint) | ||
} |
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