Skip to content

Fix Docker integration tests - resolve container startup and API access issues#12

Closed
Claude wants to merge 4 commits intomainfrom
claude/fix-docker-integration-tests
Closed

Fix Docker integration tests - resolve container startup and API access issues#12
Claude wants to merge 4 commits intomainfrom
claude/fix-docker-integration-tests

Conversation

@Claude
Copy link
Copy Markdown
Contributor

@Claude Claude AI commented Mar 31, 2026

  • Diagnose CI failure: API returns HTTP 302 to /setup because settings table is empty
  • Fix Start-TestEnvironment.ps1: POST to /setup/user (creates user + settings) instead of using tinker for user and /setup/migrate for wizard
  • Fix integration.yml: Remove redundant "Complete Snipe-IT setup wizard" step

Claude AI and others added 2 commits March 31, 2026 21:49
- Create docker-compose.yml with MySQL 8.0 and Snipe-IT with proper healthchecks
- Add Start-TestEnvironment.ps1 to provision Docker stack, run migrations, install Passport, create admin user, and generate API tokens
- Add Stop-TestEnvironment.ps1 to cleanly tear down Docker environment
- Add SnipeIT.Integration.Tests.ps1 with comprehensive test suite covering Categories, Manufacturers, Status Labels, Models, Assets, Users, and checkout/checkin workflows
- Add .github/workflows/integration.yml for CI/CD integration testing
- Fix healthcheck to verify Apache is responding instead of checking API endpoint (which redirects to setup wizard before completion)
- Implement OAuth2/Passport setup with artisan commands for token generation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

Agent-Logs-Url: https://github.com/djeborn/snipe-it-ps/sessions/d39472ae-56d4-4adf-9686-9d8592f970fa

Co-authored-by: djeborn <116414068+djeborn@users.noreply.github.com>
Includes setup instructions, troubleshooting guide, and CI/CD documentation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

Agent-Logs-Url: https://github.com/djeborn/snipe-it-ps/sessions/d39472ae-56d4-4adf-9686-9d8592f970fa

Co-authored-by: djeborn <116414068+djeborn@users.noreply.github.com>
@Claude Claude AI changed the title [WIP] Fix Docker integration tests for Snipe-IT Fix Docker integration tests - resolve container startup and API access issues Mar 31, 2026
@Claude Claude AI requested a review from djeborn March 31, 2026 21:55
@djeborn
Copy link
Copy Markdown
Owner

djeborn commented Mar 31, 2026

@copilot - Fix the failing tests.

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 31, 2026

@copilot - Fix the failing tests.

The root cause was that SetupCheckMiddleware blocks all requests (including API) until the settings table has at least one row. The previous code posted to /setup/migrate (which only runs migrations) instead of /setup/user (which creates both the first admin user and the settings record).

Fixed in commit 7ed53d9:

  • Start-TestEnvironment.ps1: now GETs /setup/user for a CSRF token, then POSTs to /setup/user with the full form data — this is the official Snipe-IT path that creates both the user and the settings row atomically. Also added a MySQL query to verify the settings row was created before proceeding.
  • integration.yml: removed the redundant "Complete Snipe-IT setup wizard" step (it was posting to the wrong endpoint anyway).

@djeborn djeborn closed this Mar 31, 2026
@djeborn djeborn deleted the claude/fix-docker-integration-tests branch March 31, 2026 23:22
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