Skip to content

feat: move shared ports out of experiment #13120

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

Merged
merged 8 commits into from
May 2, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
skip test
  • Loading branch information
f0ssel committed May 1, 2024
commit f7e01ad777c22a93b1dce034e7b7d3eca628a12e
5 changes: 4 additions & 1 deletion coderd/prometheusmetrics/prometheusmetrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,10 @@ func TestAgentStats(t *testing.T) {
func TestExperimentsMetric(t *testing.T) {
t.Parallel()

if len(codersdk.ExperimentsAll) == 0 {
t.Skip("No experiments are currently defined; skipping test.")
}
Comment on lines +514 to +516
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dannykopping I see these prom metrics are somewhat assuming that the len(codersdk.ExperimentsAll) will always be at least > 0, but with the removal of shared ports we currently have an empty slice for it and it's failing these tests. Let me know if you'd like me to do something besides skipping these under that condition in this PR. Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We spoke offline, he gave me the 👍 for now and we'll make the changes to get these tests running again soon.


tests := []struct {
name string
experiments codersdk.Experiments
Expand Down Expand Up @@ -549,7 +553,6 @@ func TestExperimentsMetric(t *testing.T) {
out, err := reg.Gather()
require.NoError(t, err)
require.Lenf(t, out, 1, "unexpected number of registered metrics")

seen := make(map[codersdk.Experiment]float64)

for _, metric := range out[0].GetMetric() {
Expand Down