Skip to content

Commit

Permalink
[CHANGE] import share was previously constrained to services. But w…
Browse files Browse the repository at this point in the history
…ith the new tracing functionality this is no longer true, as I understand it anything can be traced.
  • Loading branch information
aricart committed Feb 1, 2024
1 parent f923b10 commit dfd3923
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
3 changes: 0 additions & 3 deletions v2/imports.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ func (i *Import) Validate(actPubKey string, vr *ValidationResults) {
}
}

if i.Share && !i.IsService() {
vr.AddError("sharing information (for latency tracking) is only valid for services: %q", i.Subject)
}
var act *ActivationClaims

if i.Token != "" {
Expand Down
24 changes: 0 additions & 24 deletions v2/imports_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,30 +291,6 @@ func TestStreamImportWithWildcardPrefix(t *testing.T) {
}
}

func TestStreamImportInformationSharing(t *testing.T) {
ak := createAccountNKey(t)
akp := publicKey(ak, t)
// broken import share won't work with streams
i := &Import{Subject: "foo", Account: akp, Type: Stream, Share: true}
vr := CreateValidationResults()
i.Validate("", vr)

if len(vr.Issues) != 1 {
t.Errorf("should have registered 1 issues with this import, got %d", len(vr.Issues))
}
if !vr.IsBlocking(true) {
t.Fatalf("issue is expected to be blocking")
}
// import share will work with service
i.Type = Service
vr = CreateValidationResults()
i.Validate("", vr)

if len(vr.Issues) != 0 {
t.Errorf("should have registered 0 issues with this import, got %d", len(vr.Issues))
}
}

func TestImportsValidation(t *testing.T) {
ak := createAccountNKey(t)
akp := publicKey(ak, t)
Expand Down

0 comments on commit dfd3923

Please sign in to comment.