Skip to content

Fixed tests so they work on localhost#715

Draft
ToreMerkely wants to merge 1 commit intomainfrom
fix-tests-for-local-run
Draft

Fixed tests so they work on localhost#715
ToreMerkely wants to merge 1 commit intomainfrom
fix-tests-for-local-run

Conversation

@ToreMerkely
Copy link
Contributor

The problem was that we now get a warning when we
are missing repo information. That is available in CI
but not on localhost. We just fake it.

The problem was that we now get a warning when we
are missing repo information. That is available in CI
but not on localhost. We just fake it.
@ToreMerkely ToreMerkely enabled auto-merge (squash) March 20, 2026 13:50
@ToreMerkely ToreMerkely marked this pull request as draft March 20, 2026 14:26
auto-merge was automatically disabled March 20, 2026 14:26

Pull request was converted to draft

@ToreMerkely ToreMerkely requested a review from Copilot March 20, 2026 14:26
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

Updates local test execution so repo metadata is available (avoiding the “Repo information will not be reported…” warning) by injecting GitHub-style environment variables when running integration test targets via make.

Changes:

  • Add FAKE_CI_ENV Makefile variable containing GitHub env vars used for repo info detection.
  • Apply FAKE_CI_ENV to multiple test_integration* targets when invoking gotestsum.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


# Fake CI env vars so that tests don't emit "Repo information will not be reported" warnings.
# These are only used when running tests locally (real CI already sets them).
FAKE_CI_ENV = GITHUB_RUN_NUMBER=1 GITHUB_SERVER_URL=https://github.com GITHUB_REPOSITORY=kosli-dev/cli GITHUB_REPOSITORY_ID=123456
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

FAKE_CI_ENV is injected unconditionally into the test targets, so running these targets in GitHub Actions will override the real GITHUB_* values (not just fill them in locally). That conflicts with the comment and can lead to incorrect repo metadata being used during CI runs.

Consider making FAKE_CI_ENV empty when GITHUB_RUN_NUMBER (or another CI marker) is already set, or set per-variable defaults in the recipe (only if unset) so CI-provided values are preserved.

Suggested change
FAKE_CI_ENV = GITHUB_RUN_NUMBER=1 GITHUB_SERVER_URL=https://github.com GITHUB_REPOSITORY=kosli-dev/cli GITHUB_REPOSITORY_ID=123456
FAKE_CI_ENV_VARS = GITHUB_RUN_NUMBER=1 GITHUB_SERVER_URL=https://github.com GITHUB_REPOSITORY=kosli-dev/cli GITHUB_REPOSITORY_ID=123456
FAKE_CI_ENV = $(if $(GITHUB_RUN_NUMBER),,$(FAKE_CI_ENV_VARS))

Copilot uses AI. Check for mistakes.
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