Skip to content

Fix test compilation, document user_delegate, cover concurrent-update retry - #26

Open
kisst wants to merge 7 commits into
SamuZad:mainfrom
kisst:docs-and-test-coverage
Open

Fix test compilation, document user_delegate, cover concurrent-update retry#26
kisst wants to merge 7 commits into
SamuZad:mainfrom
kisst:docs-and-test-coverage

Conversation

@kisst

@kisst kisst commented Jun 9, 2026

Copy link
Copy Markdown

This PR improves documentation accuracy, test coverage, and adds CI. Seven atomic commits; each builds and passes go vet + make test on its own.

1. Fix non-constant format string vet errors in tests

The test package did not compile under Go 1.24's go vet: 29 non-constant format string errors across 11 files (e.g. fmt.Errorf(diags[0].Summary), t.Fatalf(err.Error())). Fixed with "%s" format strings.

2. Add docs and example for googleworkspace_user_delegate

user_delegate was the only resource missing from docs/. Added the example and regenerated via tfplugindocs; only user_delegate.md changes.

3. Add unit tests for isConcurrentUpdateError retry predicate

The 412 / 400 Invalid Input: resource_id retry paths had no coverage. Adds both retryable cases, two negative cases, and a non-Google-error case.

4. Correct README to reflect the community fork

The README was the upstream template verbatim (claimed HashiCorp maintainership, HashiCorp legal disclaimer, links to the archived upstream). Repoints maintainer/badges/links at this fork, notes the upstream archival, corrects the Go floor (>= 1.24), and points the Unit tests badge at the new workflow (commit 6). MPL copyright and Special Recognition kept.

5. Fix stale TestConsistencyCheckReachedConsistency expectations

Commit 86270a6 lowered numConsistent from 4 to 2 but didn't update this test, which asserted against currConsistent=4 and failed deterministically. Now references numConsistent directly so it tracks the constant.

6. Add Unit tests GitHub Actions workflow

The README advertised a Unit tests badge but no workflow existed and the test package was never run in CI. Runs build, vet, and make test on pushes to main and on PRs. Actions pinned to current commit SHAs (checkout v6.0.3, setup-go v6.4.0). Validated with actionlint.

7. Bump checkout and setup-go action pins in release workflow

release.yml pinned actions/checkout v3.5.3 and actions/setup-go v4.1.0; bumped to current v6.0.3 / v6.4.0 (immutable SHA pins) to match the new test workflow.

Testing

  • go build ./..., go vet ./..., make test — all clean at HEAD
  • Action pins verified: each SHA carries the tag its comment claims
  • Acceptance tests (TestAcc*) require a live Workspace tenant and were not run.

Opened as a draft for maintainer review.

kisst added 3 commits June 9, 2026 11:48
go vet (run by go test on Go 1.24) rejected fmt.Errorf/t.Fatalf calls passing a dynamic string as the format. The test package failed to compile; this blocked running any tests in it.
The resource shipped in v0.8 but docs were last regenerated before it was added, leaving it the only undocumented resource. Adds the missing example and regenerates the page via tfplugindocs.
The 412 and 400 'Invalid Input: resource_id' retry paths added for eventual-consistency handling had no coverage. Tests assert both retryable cases plus negative cases so the predicate can't silently widen.
@kisst
kisst force-pushed the docs-and-test-coverage branch 2 times, most recently from 63f5221 to fbd9d22 Compare June 9, 2026 10:07
kisst added 4 commits June 9, 2026 12:11
The README was the upstream template verbatim: it claimed HashiCorp maintainership, carried HashiCorp's experimental-status legal disclaimer, and release/issue/registry/contribution links pointing at the archived upstream. Repoints them at this fork, states the actual maintainer, notes the upstream archival, corrects the Go floor (>= 1.24), and points the Unit tests badge at the new workflow. HashiCorp's MPL copyright and Special Recognition are kept.
Commit 86270a6 lowered numConsistent from 4 to 2 but did not update this test, which still asserted against currConsistent=4 and failed deterministically. Reference numConsistent directly so the test tracks the constant.
The README advertised a Unit tests badge but no such workflow existed, and the test package was never run in CI. Runs build, vet, and 'make test' on pushes to main and on PRs. Pins actions to current SHAs (checkout v6.0.3, setup-go v6.4.0).
release.yml pinned actions/checkout v3.5.3 and actions/setup-go v4.1.0; bump to current v6.0.3 / v6.4.0 to match the new test workflow.
@kisst
kisst force-pushed the docs-and-test-coverage branch from fbd9d22 to 07307a6 Compare June 9, 2026 10:12
@kisst
kisst marked this pull request as ready for review June 9, 2026 10:12
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.

1 participant