Skip to content

Test profile data source against Kernel - #91

Merged
IlyaasK merged 1 commit into
mainfrom
hypeship/profile-data-source-acceptance
Jul 29, 2026
Merged

Test profile data source against Kernel#91
IlyaasK merged 1 commit into
mainfrom
hypeship/profile-data-source-acceptance

Conversation

@IlyaasK

@IlyaasK IlyaasK commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • create a uniquely named durable profile fixture through internal/kernelclient
  • verify kernel_profile lookup by canonical ID and exact name
  • cover explicit and provider-default project scope
  • verify durable creation metadata and an empty second plan
  • delete the fixture, require coded not_found, and add the package to the manual acceptance workflow

Why

The selected provider release retains the existing kernel_profile data source. This PR supplies live coverage for its supported durable metadata lookup paths without adding a Terraform profile resource or modeling profile archive contents.

Scope

This PR contains only the profile data-source acceptance test and its workflow matrix entry. Acceptance-matrix and release documentation remain in their dedicated later PRs.

It does not add profile resources, archive download, browser-session profile saves, or runtime operations.

Terraform semantics

  • ID lookup uses an explicit project_id
  • exact-name lookup uses the provider-default KERNEL_PROJECT_ID
  • both selectors settle the same canonical profile metadata
  • omitted project scope remains omitted in Terraform state
  • a second plan is empty
  • cleanup deletes by canonical ID and verifies exact coded not_found

Tests

  • go test -short -timeout=2m ./internal/datasources/profile
  • go test -race -short -timeout=2m ./internal/datasources/profile
  • env -u TF_ACC KERNEL_ACC=1 KERNEL_API_KEY=test KERNEL_PROJECT_ID=test KERNEL_BASE_URL=http://127.0.0.1:1 go test -count=1 -timeout=2m -v ./internal/datasources/profile -run '^TestAccProfileDataSourceByIDAndName$'
  • go test -short -timeout=2m ./...
  • go vet ./...
  • go mod verify
  • go mod tidy -diff
  • gofmt -l cmd internal
  • terraform fmt -check -recursive examples
  • bash scripts/check-docs.sh
  • bash scripts/check-markdown-links.sh

Acceptance status

The opt-in guard was verified without making a network request. A live API run was not performed because acceptance credentials are not available in this environment. The manual workflow remains a release gate.


Note

Low Risk
Test-only and CI workflow changes with no provider runtime behavior modifications.

Overview
Adds live Terraform acceptance tests for the existing kernel_profile data source and wires them into the manual Acceptance workflow matrix.

The new test creates a real profile via the API, then asserts lookup by ID (with explicit project_id) and lookup by exact name (using the provider-default project) return the same metadata, including that name-based reads omit project_id in state. It also runs an empty second plan and registers cleanup that deletes the fixture and asserts a not_found read afterward.

The acceptance workflow gains a Profile data source job on ./internal/datasources/profile with project_id_required: true, matching other project-scoped packages.

Reviewed by Cursor Bugbot for commit c2d40a7. Bugbot is set up for automated code reviews on this repo. Configure here.

@IlyaasK
IlyaasK marked this pull request as ready for review July 11, 2026 18:12
@IlyaasK
IlyaasK requested review from Sayan- and tnsardesai and removed request for Sayan- and tnsardesai July 11, 2026 18:12
@IlyaasK
IlyaasK force-pushed the hypeship/profile-acceptance-fixture branch from f261fcf to ebe560c Compare July 13, 2026 13:35
@IlyaasK
IlyaasK force-pushed the hypeship/profile-data-source-acceptance branch 2 times, most recently from f3131d6 to dcf7b87 Compare July 13, 2026 14:32
@IlyaasK
IlyaasK force-pushed the hypeship/profile-acceptance-fixture branch from 8015701 to edbd925 Compare July 13, 2026 15:39
@IlyaasK
IlyaasK force-pushed the hypeship/profile-data-source-acceptance branch from dcf7b87 to e81feb3 Compare July 13, 2026 15:39
@IlyaasK
IlyaasK force-pushed the hypeship/profile-data-source-acceptance branch from e81feb3 to 9148711 Compare July 20, 2026 19:38
@IlyaasK
IlyaasK force-pushed the hypeship/profile-acceptance-fixture branch 2 times, most recently from 65878a3 to f4c6b1b Compare July 21, 2026 14:46
@IlyaasK
IlyaasK force-pushed the hypeship/profile-data-source-acceptance branch from 9148711 to 6d545f6 Compare July 21, 2026 14:46
@IlyaasK
IlyaasK force-pushed the hypeship/profile-acceptance-fixture branch from f4c6b1b to d46c205 Compare July 21, 2026 18:10
@IlyaasK
IlyaasK force-pushed the hypeship/profile-data-source-acceptance branch from 6d545f6 to acf09bb Compare July 21, 2026 18:10
@IlyaasK
IlyaasK force-pushed the hypeship/profile-acceptance-fixture branch from d46c205 to bf17abf Compare July 21, 2026 19:51
@IlyaasK
IlyaasK force-pushed the hypeship/profile-data-source-acceptance branch from acf09bb to 349fbf4 Compare July 21, 2026 19:51
@IlyaasK
IlyaasK force-pushed the hypeship/profile-acceptance-fixture branch from bf17abf to 18714b7 Compare July 21, 2026 20:15
@IlyaasK
IlyaasK force-pushed the hypeship/profile-data-source-acceptance branch from 349fbf4 to 00082ec Compare July 21, 2026 20:15
@IlyaasK
IlyaasK force-pushed the hypeship/profile-acceptance-fixture branch 2 times, most recently from cf2406a to 1d4b930 Compare July 27, 2026 19:58
@IlyaasK
IlyaasK force-pushed the hypeship/profile-data-source-acceptance branch from 00082ec to bfef988 Compare July 27, 2026 20:01
@IlyaasK
IlyaasK requested a review from Sayan- July 27, 2026 21:31
@IlyaasK
IlyaasK force-pushed the hypeship/profile-acceptance-fixture branch from 1d4b930 to 1699975 Compare July 29, 2026 14:10
@IlyaasK
IlyaasK changed the base branch from hypeship/profile-acceptance-fixture to main July 29, 2026 14:15
@IlyaasK
IlyaasK force-pushed the hypeship/profile-data-source-acceptance branch from bfef988 to c2d40a7 Compare July 29, 2026 14:15
@IlyaasK
IlyaasK merged commit 0e727f6 into main Jul 29, 2026
2 checks passed
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.

2 participants