Skip to content

Fix test environment setup and build system issues#546

Merged
greghaynes merged 3 commits intomainfrom
copilot/fix-84cdaeaf-bae7-4990-aed5-e80f79917a31
Dec 19, 2025
Merged

Fix test environment setup and build system issues#546
greghaynes merged 3 commits intomainfrom
copilot/fix-84cdaeaf-bae7-4990-aed5-e80f79917a31

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Sep 11, 2025

  • Fix Makefile syntax error (space missing between -p 1 and --tags=integration)
  • Fix envtest environment setup for integration tests
  • Ensure Docker API compatibility is working correctly
  • Revert accidental modification to gitea/k8s/install.yaml file
  • Verify all tests pass after fixes

Issues Fixed

1. Integration Test Failures

The integration tests in pkg/controllers/custompackage were failing because the envtest environment couldn't locate the required Kubernetes binaries. The tests were looking for etcd, kube-apiserver, and kubectl binaries but they weren't being installed properly.

Root Cause: The KUBEBUILDER_ASSETS environment variable wasn't being set correctly, and the envtest binaries weren't being downloaded.

Solution: Fixed the envtest setup to properly download and configure the Kubernetes test binaries at the expected location (bin/k8s/1.29.1-linux-amd64/).

2. Makefile Syntax Error

There was a syntax error in the Makefile's test target on line 43 where a space was missing between -p 1 and --tags=integration.

-KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test -p 1--tags=integration ./... -coverprofile cover.out -run $(RUN)
+KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test -p 1 --tags=integration ./... -coverprofile cover.out -run $(RUN)

3. Accidental File Modification

Reverted an accidental modification to pkg/controllers/localbuild/resources/gitea/k8s/install.yaml that was not related to the core issues being fixed.

Test Results

After these fixes:

  • ✅ All unit tests pass (100% success rate)
  • ✅ All integration tests pass (including the previously failing controller tests)
  • ✅ Complete build pipeline works end-to-end (make build succeeds)
  • ✅ Generated binary is functional and responds to commands

The repository is now in a fully functional state with all tests passing and builds working correctly.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: jessesanford <108698+jessesanford@users.noreply.github.com>
Copilot AI changed the title [WIP] I would like you to run all the tests and make sure that they all run correctly and that all packages can be built successfully I believe that there are some errors around the use of older Docker APIs and possibly some issues with KIND as well. Fix test environment setup and build system issues Sep 11, 2025
Copilot AI requested a review from jessesanford September 11, 2025 02:37
@jessesanford jessesanford marked this pull request as ready for review September 11, 2025 16:51
@jessesanford jessesanford requested a review from a team as a code owner September 11, 2025 16:51
@jessesanford
Copy link
Copy Markdown
Contributor

why did you modify pkg/controllers/localbuild/resources/gitea/k8s/install.yaml @copilot ?

Co-authored-by: jessesanford <108698+jessesanford@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Sep 11, 2025

why did you modify pkg/controllers/localbuild/resources/gitea/k8s/install.yaml @copilot ?

You're absolutely right to question this. That modification was accidental and not related to the issues I was fixing. I've reverted the file back to its original state in commit 163c2f7. The gitea install.yaml file now contains all the original Kubernetes manifests as it should.

@greghaynes greghaynes merged commit 9c528ec into main Dec 19, 2025
5 checks passed
@greghaynes greghaynes deleted the copilot/fix-84cdaeaf-bae7-4990-aed5-e80f79917a31 branch December 19, 2025 16:50
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