Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
"gopkg.in/yaml.v3"
)

// nexusFeatureDirPrefix marks features that require a per-test Nexus endpoint.
// nexusFeatureDirPrefix preserves automatic endpoint creation for Nexus features.
const nexusFeatureDirPrefix = "nexus/"

const (
Expand Down Expand Up @@ -457,9 +457,8 @@ func (r *Runner) runBatch(ctx context.Context, batch runBatch) error {
return err
}

// Create a Nexus endpoint per feature under features/nexus/ targeting that feature's task
// queue. Endpoint names are passed to the lang harness through RunFeature.NexusEndpoint and
// the endpoints are deleted once the lang harness completes.
// Create a Nexus endpoint for Nexus features and other features that request one. Endpoint
// names are passed to the language harness and deleted once it completes.
deleteEndpoints, err := r.createNexusEndpoints(ctx, config, batch.Run)
if err != nil {
return err
Expand Down Expand Up @@ -853,14 +852,14 @@ func rootDir() string {
return filepath.Dir(filepath.Dir(currFile))
}

// createNexusEndpoints creates a Nexus endpoint per RunFeature whose Dir is under
// features/nexus, populating RunFeature.NexusEndpoint. It returns a cleanup function that
// deletes the created endpoints. The cleanup function is always safe to call.
// createNexusEndpoints creates an endpoint for Nexus features and features that request one.
// It returns a cleanup function that is always safe to call.
func (r *Runner) createNexusEndpoints(ctx context.Context, config RunConfig, run *cmd.Run) (func(), error) {
noop := func() {}
var nexusFeatures []*cmd.RunFeature
for i := range run.Features {
if strings.HasPrefix(run.Features[i].Dir, nexusFeatureDirPrefix) {
if strings.HasPrefix(run.Features[i].Dir, nexusFeatureDirPrefix) ||
run.Features[i].Config.NeedsNexusEndpoint {
nexusFeatures = append(nexusFeatures, &run.Features[i])
}
}
Expand Down Expand Up @@ -930,6 +929,9 @@ func (r *Runner) createNexusEndpoints(ctx context.Context, config RunConfig, run
r.log.Warn("Skipping Nexus features: server does not support Nexus endpoint creation",
"Feature", feature.Dir, "Error", err)
cleanup()
for i := range run.Features {
run.Features[i].NexusEndpoint = ""
}
kept := run.Features[:0]
for _, f := range run.Features {
if !strings.HasPrefix(f.Dir, nexusFeatureDirPrefix) {
Expand Down
3 changes: 3 additions & 0 deletions features/data_converter/transfer_types/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"needsNexusEndpoint": true
}
Loading
Loading