@@ -115,12 +115,12 @@ func TestDataSourceMetadataAndSchema(t *testing.T) {
115115
116116 var schema datasource.SchemaResponse
117117 ds .Schema (context .Background (), datasource.SchemaRequest {}, & schema )
118- for _ , name := range []string {"id" , "name" , "created_at" , "size_bytes" , "last_used_at" } {
118+ for _ , name := range []string {"id" , "name" , "created_at" , "size_bytes" } {
119119 if _ , ok := schema .Schema .Attributes [name ]; ! ok {
120120 t .Fatalf ("schema missing %s attribute" , name )
121121 }
122122 }
123- for _ , name := range []string {"download_url" , "zip_file" } {
123+ for _ , name := range []string {"download_url" , "zip_file" , "last_used_at" } {
124124 if _ , ok := schema .Schema .Attributes [name ]; ok {
125125 t .Fatalf ("schema should not include %s" , name )
126126 }
@@ -168,9 +168,6 @@ func TestReadSetsTerraformState(t *testing.T) {
168168 if state .SizeBytes .ValueInt64 () != 1234 {
169169 t .Fatalf ("state size_bytes = %d, want 1234" , state .SizeBytes .ValueInt64 ())
170170 }
171- if state .LastUsedAt .ValueString () != "2026-06-05T12:00:00Z" {
172- t .Fatalf ("state last_used_at = %q, want 2026-06-05T12:00:00Z" , state .LastUsedAt .ValueString ())
173- }
174171}
175172
176173func TestReadExtensionByID (t * testing.T ) {
@@ -237,24 +234,6 @@ func TestReadExtensionAllowsNullableName(t *testing.T) {
237234 }
238235}
239236
240- func TestReadExtensionAllowsNullableLastUsedAt (t * testing.T ) {
241- t .Parallel ()
242-
243- ds := newDataSourceWithClient (fakeExtensionClient {
244- get : func (ctx context.Context , projectID , idOrName string ) (* kernel.ExtensionGetResponse , error ) {
245- return extensionWithoutLastUsedForTest ("extension-1" , "Extension" ), nil
246- },
247- })
248-
249- state , diags := ds .read (context .Background (), extensionModel {ID : types .StringValue ("extension-1" )})
250- if diags .HasError () {
251- t .Fatalf ("unexpected diagnostics: %v" , diags )
252- }
253- if ! state .LastUsedAt .IsNull () {
254- t .Fatalf ("state last_used_at = %q, want null" , state .LastUsedAt .ValueString ())
255- }
256- }
257-
258237func TestReadRejectsExtensionNotFound (t * testing.T ) {
259238 t .Parallel ()
260239
@@ -339,10 +318,6 @@ func extensionWithoutNameForTest(id string) *kernel.ExtensionGetResponse {
339318 return extensionFromJSON (`{"id":"` + id + `","name":null,"created_at":"2026-06-05T12:00:00Z","size_bytes":1234,"last_used_at":"2026-06-05T12:00:00Z"}` )
340319}
341320
342- func extensionWithoutLastUsedForTest (id , name string ) * kernel.ExtensionGetResponse {
343- return extensionFromJSON (`{"id":"` + id + `","name":"` + name + `","created_at":"2026-06-05T12:00:00Z","size_bytes":1234,"last_used_at":null}` )
344- }
345-
346321func invalidExtension () * kernel.ExtensionGetResponse {
347322 extension := extensionForTest ("extension-1" , "Extension" )
348323 extension .CreatedAt = time.Time {}
@@ -362,21 +337,19 @@ func extensionConfigValue(id, name tftypes.Value) tftypes.Value {
362337 return tftypes .NewValue (
363338 tftypes.Object {
364339 AttributeTypes : map [string ]tftypes.Type {
365- "id" : tftypes .String ,
366- "name" : tftypes .String ,
367- "project_id" : tftypes .String ,
368- "created_at" : tftypes .String ,
369- "size_bytes" : tftypes .Number ,
370- "last_used_at" : tftypes .String ,
340+ "id" : tftypes .String ,
341+ "name" : tftypes .String ,
342+ "project_id" : tftypes .String ,
343+ "created_at" : tftypes .String ,
344+ "size_bytes" : tftypes .Number ,
371345 },
372346 },
373347 map [string ]tftypes.Value {
374- "id" : id ,
375- "name" : name ,
376- "project_id" : tftypes .NewValue (tftypes .String , nil ),
377- "created_at" : tftypes .NewValue (tftypes .String , nil ),
378- "size_bytes" : tftypes .NewValue (tftypes .Number , nil ),
379- "last_used_at" : tftypes .NewValue (tftypes .String , nil ),
348+ "id" : id ,
349+ "name" : name ,
350+ "project_id" : tftypes .NewValue (tftypes .String , nil ),
351+ "created_at" : tftypes .NewValue (tftypes .String , nil ),
352+ "size_bytes" : tftypes .NewValue (tftypes .Number , nil ),
380353 },
381354 )
382355}
0 commit comments