metadata_test.go 462 B

123456789101112131415161718192021
  1. // Copyright The OpenTelemetry Authors
  2. // SPDX-License-Identifier: Apache-2.0
  3. package endpoints
  4. import (
  5. "testing"
  6. "github.com/stretchr/testify/assert"
  7. "github.com/stretchr/testify/require"
  8. )
  9. func Test_ecsPrefersLatestTME(t *testing.T) {
  10. t.Setenv(TaskMetadataEndpointV3EnvVar, "http://3")
  11. t.Setenv(TaskMetadataEndpointV4EnvVar, "http://4")
  12. tme, err := GetTMEFromEnv()
  13. require.NoError(t, err)
  14. require.NotNil(t, tme)
  15. assert.Equal(t, "4", tme.Host)
  16. }