-
Notifications
You must be signed in to change notification settings - Fork 46
Add GitHub API integration tests for JavaScript frontmatter hash algorithm with CI integration #13190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: pelikhan <[email protected]>
|
@copilot run at least one test with live data, no locks |
- Add test that uses real GitHub API (getOctokit) to fetch workflows - Test skips gracefully when GITHUB_TOKEN/GH_TOKEN not available - Add standalone test script (test-live-github-api.cjs) for manual testing - Add TESTING_LIVE_API.md documentation with usage instructions - Fetches real workflow with imports from githubnext/gh-aw - Verifies hash computation is deterministic with live API calls Co-authored-by: pelikhan <[email protected]>
Added live GitHub API test in commit b4da6e8. The test uses To run: GITHUB_TOKEN=ghp_xxx npm test -- frontmatter_hash_github_api.test.cjsAlso added:
|
|
@copilot run the test in a dedicated job in ci.yml as an integration test. Skip if GitHub token env var is not set. |
- Add js-integration-live-api job to ci.yml - Runs frontmatter_hash_github_api.test.cjs with real GitHub API - Gracefully handles missing GITHUB_TOKEN (skips live test) - Provides clear summary output in GitHub Actions - Runs after validate-yaml job for faster feedback - Uses same Node.js setup as main js job Co-authored-by: pelikhan <[email protected]>
Added dedicated CI job in commit ec0316f. The
The test will run automatically on all PRs and pushes to main. |
Validates JavaScript and Go frontmatter hash implementations produce identical outputs when fetching workflows via GitHub's repos.getContent API. Includes tests with both mocked and live GitHub API calls, plus automated CI integration.
Changes
actions/setup/js/frontmatter_hash_github_api.test.cjswith 10 testscreateGitHubFileReaderwrapper for GitHub APIaudit-workflows.md(with imports),archie.md(without imports)test-live-github-api.cjsfor manual testing with detailed outputTESTING_LIVE_API.mdwith instructions for running live API testsjs-integration-live-apijob in.github/workflows/ci.ymlthat runs the live API test automaticallyExample
Test Coverage
CI Integration
The live API test runs automatically in CI via the
js-integration-live-apijob:secrets.GITHUB_TOKENto fetch real workflow dataRunning Live API Tests
See
actions/setup/js/TESTING_LIVE_API.mdfor complete documentation on running tests with live GitHub API data.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.