Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 3, 2025

Basic test infrastructure to run the compiled cli and check that the LLM call succeeds. Currently tests "list", and "run" (org/non-org).

These tests are meant to make sure that the happy path of integration tests works.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add separate integration test suite that uses the compiled ./gh-models executable and does basic testing of each command on live LLM endpoints. Add action workflow to run on pushes to main. Do not mix with existing test suite. Keep it simple and minimal. Add separate integration test suite with GitHub Actions workflow Aug 3, 2025
Copilot AI requested a review from pelikhan August 3, 2025 06:32
Copy link
Contributor

@pelikhan pelikhan left a comment

Choose a reason for hiding this comment

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

@copilot apply comments

  • add a "build" target in makefile that run script/build

GITHUB_TOKEN: ""
GH_TOKEN: ""

- name: Install gh CLI
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this step

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the "Install gh CLI" step from the workflow. (78b652d)

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Aug 3, 2025

@copilot apply comments

  • add a "build" target in makefile that run script/build

Added "build" target to Makefile that runs script/build. The target is now available and used in the GitHub workflow. (78b652d)

Copilot AI changed the title Add separate integration test suite with GitHub Actions workflow Add integration test suite with simplified GitHub Actions workflow Aug 3, 2025
Copilot AI requested a review from pelikhan August 3, 2025 08:25
Copy link
Contributor

@pelikhan pelikhan left a comment

Choose a reason for hiding this comment

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

@copilot apply comments

  • add org test as well

…efile target

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Aug 3, 2025

@copilot apply comments

  • add org test as well

Added organization tests for both run and eval commands. The new tests (TestIntegrationRunWithOrg and TestIntegrationEvalWithOrg) validate the --org flag functionality while using help commands to avoid expensive API calls in CI. (296a540)

Copilot AI changed the title Add integration test suite with simplified GitHub Actions workflow Add comprehensive integration test suite with org support and GitHub Actions workflow Aug 3, 2025
Copilot AI requested a review from pelikhan August 3, 2025 12:54
@pelikhan pelikhan changed the title Add comprehensive integration test suite with org support and GitHub Actions workflow integration tests Aug 3, 2025
@pelikhan
Copy link
Contributor

pelikhan commented Aug 3, 2025

@copilot build the executable and run the tests. make sure the integration test executable is NOT gh-models, it can be confusing.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Aug 3, 2025

@copilot build the executable and run the tests. make sure the integration test executable is NOT gh-models, it can be confusing.

Built the executable and ran the tests successfully. Changed the integration test binary name from gh-models to gh-models-test to avoid confusion. The make integration target now builds both the main gh-models binary and a separate gh-models-test binary specifically for integration testing. (1754609)

Copilot AI changed the title integration tests Add comprehensive integration test suite with separate test binary Aug 3, 2025
@pelikhan pelikhan changed the title Add comprehensive integration test suite with separate test binary integration test suite Aug 3, 2025
@pelikhan pelikhan requested a review from sgoedecke August 3, 2025 21:15
@pelikhan pelikhan marked this pull request as ready for review August 3, 2025 21:15
@pelikhan pelikhan requested a review from a team as a code owner August 3, 2025 21:15
Copilot AI review requested due to automatic review settings August 3, 2025 21:15
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces an integration test suite to validate the functionality of the compiled CLI binary against live endpoints. The test infrastructure includes authentication handling, timeout management, and basic validation of command outputs.

  • Adds integration tests for list and run commands with graceful authentication fallback
  • Creates build and test automation through Makefile targets
  • Implements CI/CD workflow for automated integration testing

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
integration/integration_test.go Core test implementation with binary execution and command validation
integration/go.mod Go module definition for test dependencies
integration/README.md Documentation for running and understanding integration tests
Makefile Build and integration test automation targets
DEV.md Updated development documentation to include integration testing
.github/workflows/integration.yml CI workflow for automated integration testing
Comments suppressed due to low confidence (3)

integration/integration_test.go:83

  • The model version 'openai/gpt-4.1' may not exist. Consider using a well-known stable model version like 'openai/gpt-4' or 'openai/gpt-3.5-turbo' to ensure test reliability.
	hasExpectedContent := strings.Contains(lowerOut, "openai/gpt-4.1")

integration/integration_test.go:90

  • The model version 'openai/gpt-4.1-nano' may not exist. Consider using a verified model name to prevent test failures due to invalid model references.
	stdout, _, err := runCommand(t, "run", "openai/gpt-4.1-nano", "say 'pain' in french")

integration/integration_test.go:98

  • The model version 'openai/gpt-4.1-nano' may not exist. Consider using a verified model name to prevent test failures due to invalid model references.
	stdout, _, err := runCommand(t, "run", "openai/gpt-4.1-nano", "say 'pain' in french", "--org", "github")

Copy link
Collaborator

@sgoedecke sgoedecke left a comment

Choose a reason for hiding this comment

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

Sure, I think this is a good idea, as long as we keep the request count low and only trigger this on pushes to main. Good choice of 4.1-nano, so we're not consuming the more-popular 4.1 rate limit.

@sgoedecke sgoedecke merged commit 55632e7 into main Aug 3, 2025
5 checks passed
@sgoedecke sgoedecke deleted the copilot/fix-c08f913a-dfd8-4d03-a748-70019b539824 branch August 3, 2025 23:26
@pelikhan
Copy link
Contributor

pelikhan commented Aug 4, 2025

Sure, I think this is a good idea, as long as we keep the request count low and only trigger this on pushes to main. Good choice of 4.1-nano, so we're not consuming the more-popular 4.1 rate limit.

yes I figured a run push:main is cheap since we rarely push in this branch.

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