fix: skip integration tests not compatible in sidecar

A few tests are not yet compatible with sidecar mode. Add a test
option to skip these when running sidecar tests.
This commit is contained in:
Ben McClelland
2026-05-04 16:05:28 -07:00
parent d2fa265fb8
commit bb3cdd9cb6
4 changed files with 30 additions and 5 deletions

View File

@@ -38,6 +38,7 @@ var (
checksumDisable bool
versioningEnabled bool
azureTests bool
sidecarTests bool
tlsStatus bool
parallel bool
)
@@ -116,6 +117,12 @@ func initTestCommands() []*cli.Command {
Destination: &azureTests,
Aliases: []string{"azure"},
},
&cli.BoolFlag{
Name: "sidecar-test-mode",
Usage: "Skips tests that are not supported by Sidecar",
Destination: &sidecarTests,
Aliases: []string{"sidecar"},
},
&cli.BoolFlag{
Name: "parallel",
Usage: "executes the tests concurrently",
@@ -336,6 +343,9 @@ func getAction(tf testFunc) func(ctx *cli.Context) error {
if azureTests {
opts = append(opts, integration.WithAzureMode())
}
if sidecarTests {
opts = append(opts, integration.WithSidecarMode())
}
if hostStyle {
opts = append(opts, integration.WithHostStyle())
}
@@ -382,6 +392,9 @@ func extractIntTests() (commands []*cli.Command) {
if azureTests {
opts = append(opts, integration.WithAzureMode())
}
if sidecarTests {
opts = append(opts, integration.WithSidecarMode())
}
s := integration.NewS3Conf(opts...)
err := testFunc(s)
@@ -400,6 +413,12 @@ func extractIntTests() (commands []*cli.Command) {
Destination: &azureTests,
Aliases: []string{"azure"},
},
&cli.BoolFlag{
Name: "sidecar-test-mode",
Usage: "Skips tests that are not supported by Sidecar",
Destination: &sidecarTests,
Aliases: []string{"sidecar"},
},
},
})
}

View File

@@ -10,10 +10,12 @@ done
# build sidecar flag for versitygw invocations
SIDECAR_FLAG=""
SIDECAR_TEST_FLAG=""
if $USE_SIDECAR; then
rm -rf /tmp/sidecar
mkdir /tmp/sidecar
SIDECAR_FLAG="--sidecar /tmp/sidecar"
SIDECAR_TEST_FLAG="--sidecar"
fi
# make temp dirs
@@ -55,7 +57,7 @@ fi
# run tests
# full flow tests
if ! ./versitygw test -a user -s pass -e http://127.0.0.1:7070 full-flow --parallel; then
if ! ./versitygw test -a user -s pass -e http://127.0.0.1:7070 full-flow --parallel $$SIDECAR_TEST_FLAG; then
echo "full flow tests failed"
kill $GW_PID
exit 1
@@ -92,7 +94,7 @@ fi
# run tests
# full flow tests
if ! ./versitygw test --allow-insecure -a user -s pass -e https://127.0.0.1:7071 full-flow --parallel; then
if ! ./versitygw test --allow-insecure -a user -s pass -e https://127.0.0.1:7071 full-flow --parallel $$SIDECAR_TEST_FLAG; then
echo "full flow tests failed"
kill $GW_HTTPS_PID
exit 1
@@ -129,7 +131,7 @@ fi
# run tests
# full flow tests
if ! ./versitygw test -a user -s pass -e http://127.0.0.1:7072 full-flow -vs --parallel; then
if ! ./versitygw test -a user -s pass -e http://127.0.0.1:7072 full-flow -vs --parallel $$SIDECAR_TEST_FLAG; then
echo "versioning-enabled full-flow tests failed"
kill $GW_VS_PID
exit 1
@@ -161,7 +163,7 @@ fi
# run tests
# full flow tests
if ! ./versitygw test --allow-insecure -a user -s pass -e https://127.0.0.1:7073 full-flow -vs --parallel; then
if ! ./versitygw test --allow-insecure -a user -s pass -e https://127.0.0.1:7073 full-flow -vs --parallel $$SIDECAR_TEST_FLAG; then
echo "versioning-enabled full-flow tests failed"
kill $GW_VS_HTTPS_PID
exit 1

View File

@@ -551,7 +551,7 @@ func TestCompleteMultipartUpload(ts *TestState) {
}
ts.Run(CompleteMultipartUpload_success)
ts.Run(CompleteMultipartUpload_already_completed)
if !ts.conf.azureTests {
if !(ts.conf.azureTests || ts.conf.sidecarTests) {
ts.Run(CompleteMultipartUpload_racey_success)
ts.Run(CompleteMultipartUpload_racey_data_integrity)
}

View File

@@ -43,6 +43,7 @@ type S3Conf struct {
debug bool
versioningEnabled bool
azureTests bool
sidecarTests bool
tlsStatus bool
httpClient *http.Client
}
@@ -105,6 +106,9 @@ func WithVersioningEnabled() Option {
func WithAzureMode() Option {
return func(s *S3Conf) { s.azureTests = true }
}
func WithSidecarMode() Option {
return func(s *S3Conf) { s.sidecarTests = true }
}
func WithTLSStatus(ts bool) Option {
return func(s *S3Conf) { s.tlsStatus = ts }
}