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
add comments
  • Loading branch information
f0ssel committed May 2, 2024
commit ef4c07dc3bca2c78ca2fc9cea6e1eb6b7ae994d4
17 changes: 13 additions & 4 deletions coderd/prometheusmetrics/prometheusmetrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -522,16 +522,24 @@ func TestExperimentsMetric(t *testing.T) {
}{
{
name: "Enabled experiment is exported in metrics",
experiments: codersdk.Experiments{codersdk.ExperimentExample},
experiments: codersdk.Experiments{
// TODO: We need to use a real experiment from codersdk.ExperimentsAll
// when the slice is not empty. Uncomment when that happens.
// codersdk.ExperimentSharedPorts,
},
expected: map[codersdk.Experiment]float64{
codersdk.ExperimentExample: 1,
// TODO: We need to use a real experiment from codersdk.ExperimentsAll
// when the slice is not empty. Uncomment when that happens.
// codersdk.ExperimentSharedPorts: 1,
},
},
{
name: "Disabled experiment is exported in metrics",
experiments: codersdk.Experiments{},
expected: map[codersdk.Experiment]float64{
codersdk.ExperimentExample: 0,
expected: map[codersdk.Experiment]float64{
// TODO: We need to use a real experiment from codersdk.ExperimentsAll
// when the slice is not empty. Uncomment when that happens.
// codersdk.ExperimentSharedPorts: 0,
},
},
{
Expand All @@ -553,6 +561,7 @@ 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
Loading