normalize_timestamps_test.go 612 B

12345678910111213141516171819202122
  1. // Copyright The OpenTelemetry Authors
  2. // SPDX-License-Identifier: Apache-2.0
  3. package golden // import "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden"
  4. import (
  5. "path/filepath"
  6. "testing"
  7. "github.com/stretchr/testify/require"
  8. )
  9. func TestNormalizeTimestamps(t *testing.T) {
  10. dir := filepath.Join("testdata", "timestamp-norm")
  11. before, err := ReadMetrics(filepath.Join(dir, "before_normalize.yaml"))
  12. require.NoError(t, err)
  13. after, err := ReadMetrics(filepath.Join(dir, "after_normalize.yaml"))
  14. require.NoError(t, err)
  15. normalizeTimestamps(before)
  16. require.Equal(t, before, after)
  17. }