mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Update nvproxy parity tests to run in parallel.
This test file now takes ~30 seconds instead of ~4 minutes. PiperOrigin-RevId: 662702276
This commit is contained in:
@@ -81,13 +81,15 @@ func getDriverDefs(t *testing.T, runner *parser.Runner, version nvproxy.DriverVe
|
||||
// TestSupportedStructNames tests that all the structs listed in nvproxy are found in the driver
|
||||
// source code.
|
||||
func TestSupportedStructNames(t *testing.T) {
|
||||
f, runner := createParserRunner(t)
|
||||
defer f.Close()
|
||||
nvproxy.Init()
|
||||
|
||||
// Run the parser on all supported driver versions
|
||||
nvproxy.ForEachSupportDriver(func(version nvproxy.DriverVersion, checksum string) {
|
||||
t.Run(version.String(), func(t *testing.T) {
|
||||
t.Parallel()
|
||||
f, runner := createParserRunner(t)
|
||||
defer f.Close()
|
||||
|
||||
structNames, defs := getDriverDefs(t, runner, version)
|
||||
|
||||
// Check that every struct is found in the parser output.
|
||||
@@ -102,13 +104,17 @@ func TestSupportedStructNames(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
// TestStructDefinitionParity tests that the struct definitions in nvproxy are the same as the
|
||||
// definitions in the driver source code.
|
||||
func TestStructDefinitionParity(t *testing.T) {
|
||||
f, runner := createParserRunner(t)
|
||||
defer f.Close()
|
||||
nvproxy.Init()
|
||||
|
||||
nvproxy.ForEachSupportDriver(func(version nvproxy.DriverVersion, checksum string) {
|
||||
t.Run(version.String(), func(t *testing.T) {
|
||||
t.Parallel()
|
||||
f, runner := createParserRunner(t)
|
||||
defer f.Close()
|
||||
|
||||
_, defs := getDriverDefs(t, runner, version)
|
||||
|
||||
nvproxyDefs, ok := nvproxy.SupportedStructTypes(version)
|
||||
|
||||
Reference in New Issue
Block a user