Skip to content
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

Nightly Fix: Test using FF gated code not marked with skipUnlessBeta #1041

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Maed223
Copy link
Contributor

@Maed223 Maed223 commented Jan 21, 2025

Description

Currently the nightly fails on TestAdminTerraformVersions_CreateDelete with a nil pointer dereference– namely due to these assertions:

assert.Equal(t, *opts.URL, tfv.URL)
assert.Equal(t, *opts.Sha, tfv.Sha)

Since the URL and SHA aren't present in the struct.

The reason they aren't being rendered in the response from atlas is due to their serialization being gated by the arm64-agent-support feature flag.

in tool_version_serializer.rb:

 attribute :archs, if: -> { feature_on?(Feature::Flags::ARM64_AGENT_SUPPORT, context: current_user) }

def archs
  ActiveModelSerializers::SerializableResource.new(
      object.architectures,
      each_serializer: ToolVersionArchitectureSerializer,
      adapter: :attributes
    ).serializable_hash
end

Then in ToolVersionArchitectureSerializer

# typed: true
module Api
  module V2
    module Admin
      class ToolVersionArchitectureSerializer < BaseSerializer
        attributes :url, :sha, :os, :arch
      end
    end
  end
end

As such I've added the skipUnlessBeta helper to the affected test

@Maed223 Maed223 requested a review from a team as a code owner January 21, 2025 16:34
Copy link
Collaborator

@ctrombley ctrombley left a comment

Choose a reason for hiding this comment

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

This is fine for now, but there may actually be a bug surfaced by this test. We will want to re-enable this once the issue is addressed.

@datadog-terraform-cloud-hashicorp

Datadog Report

Branch report: fixing-nightly-tests-uses-code-gated-by-FF
Commit report: 4e3c5c9
Test service: hashicorp/go-tfe

✅ 0 Failed, 1421 Passed, 162 Skipped, 23m 37.42s Total Time
➡️ Test Sessions change in coverage: 1 no change

@Maed223
Copy link
Contributor Author

Maed223 commented Jan 21, 2025

This is fine for now, but there may actually be a bug surfaced by this test. We will want to re-enable this once the issue is addressed.

Ah, this is a regression since those attributes were being serialized without the FF previously

@@ -97,6 +97,7 @@ func TestAdminTerraformVersions_List(t *testing.T) {

func TestAdminTerraformVersions_CreateDelete(t *testing.T) {
skipUnlessEnterprise(t)
skipUnlessBeta(t)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it just the first t.Run test with arches that needs to be skipped unless beta?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants