-
Notifications
You must be signed in to change notification settings - Fork 14
Allow configuration of analytics pixel URL #3718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
4ae8db3
fe68723
59967fd
504a4af
06c31a1
7c46686
bb06110
fee4843
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -644,6 +644,42 @@ func (suite *AnalyticsIntegrationTestSuite) TestCIAndInteractiveDimensions() { | |
| } | ||
| } | ||
|
|
||
| func (suite *AnalyticsIntegrationTestSuite) TestAnalyticsPixelOverride() { | ||
| suite.OnlyRunForTags(tagsuite.Analytics) | ||
|
|
||
| ts := e2e.New(suite.T(), false) | ||
| defer ts.Close() | ||
|
|
||
| cp := ts.Spawn("config", "set", constants.AnalyticsPixelOverrideConfig, "https://example.com") | ||
| cp.Expect("Successfully set config key") | ||
| cp.ExpectExitCode(0) | ||
|
|
||
| // Stop the service so that the next command will pick up the new config values. | ||
| // We need to do this because the analytics reporting instance will have values set that will | ||
| // be used until a new instance is created. | ||
| cp = ts.SpawnCmd(ts.SvcExe, "stop") | ||
| cp.ExpectExitCode(0) | ||
|
||
|
|
||
| cp = ts.Spawn("--version") | ||
| cp.Expect("ActiveState CLI") | ||
| cp.ExpectExitCode(0) | ||
|
|
||
| suite.eventsfile = filepath.Join(ts.Dirs.Config, reporters.TestReportFilename) | ||
| events := parseAnalyticsEvents(suite, ts) | ||
| suite.Require().NotEmpty(events) | ||
|
|
||
| foundCount := 0 | ||
| for _, e := range events { | ||
| if e.URL == "https://example.com" { | ||
| foundCount++ | ||
| } | ||
| } | ||
|
|
||
| // Because the service has already reported some events with the default configuration values, | ||
| // we expect to find at least one event with the new configuration values after the service is restarted. | ||
| suite.Greater(foundCount, 1) | ||
| } | ||
MDrakos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| func TestAnalyticsIntegrationTestSuite(t *testing.T) { | ||
| suite.Run(t, new(AnalyticsIntegrationTestSuite)) | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you make this a switch case? It's a bit frustrating to grok as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No longer needed with the new approach.