Skip to content

Conversation

@hwbrzzl
Copy link
Contributor

@hwbrzzl hwbrzzl commented Feb 3, 2026

Greptile Overview

Greptile Summary

This PR adds comprehensive tests for the build command and updates the Goravel framework to a pre-release version that includes the build command feature.

Key Changes:

  • Added TestBuildCommand which tests cross-compilation for Windows, Linux, and Darwin platforms using the build artisan command with specific flags (-s, -a=amd64, -o, -n)
  • Enhanced TearDownTest to verify the app can still be built successfully after each test runs by calling ./artisan
  • Bumped github.com/goravel/framework from v1.17.0 to pre-release v1.17.1-0.20260203082038-2649a5eced57 to support the build command

Observations:

  • The test correctly verifies binary existence after build commands
  • The cleanup process is comprehensive with git reset, clean, and go mod tidy
  • Pre-release version indicates this is testing upcoming framework functionality

Confidence Score: 4/5

  • Safe to merge with minor consideration for pre-release framework version
  • The changes are well-structured and appropriate for testing the build command. Tests follow existing patterns in the test suite. The only consideration is the use of a pre-release framework version, which should be intentional for testing purposes.
  • No files require special attention - all changes are straightforward

Important Files Changed

Filename Overview
go.mod Bumped github.com/goravel/framework from v1.17.0 to pre-release v1.17.1-0.20260203082038-2649a5eced57
go.sum Updated checksums for framework version bump, no issues detected
main_test.go Added TestBuildCommand with cross-compilation tests and improved TearDownTest with app build verification

Sequence Diagram

sequenceDiagram
    participant Test as Test Suite
    participant Artisan as Facades.Artisan
    participant Process as Facades.Process
    participant Build as Build Command
    participant FS as File System
    
    Test->>Test: TestBuildCommand()
    
    Note over Test: Windows Build
    Test->>Artisan: Call("build -s -a=amd64 -o=windows -n=goravel_windows.exe")
    Artisan->>Build: Execute build command
    Build->>FS: Create goravel_windows.exe
    FS-->>Build: Binary created
    Build-->>Artisan: Success
    Artisan-->>Test: NoError
    Test->>FS: Check file.Exists("goravel_windows.exe")
    FS-->>Test: True
    
    Note over Test: Linux Build
    Test->>Artisan: Call("build -s -a=amd64 -o=linux -n=goravel_linux")
    Artisan->>Build: Execute build command
    Build->>FS: Create goravel_linux
    FS-->>Build: Binary created
    Build-->>Artisan: Success
    Artisan-->>Test: NoError
    Test->>FS: Check file.Exists("goravel_linux")
    FS-->>Test: True
    
    Note over Test: Darwin Build
    Test->>Artisan: Call("build -s -a=amd64 -o=darwin -n=goravel_darwin")
    Artisan->>Build: Execute build command
    Build->>FS: Create goravel_darwin
    FS-->>Build: Binary created
    Build-->>Artisan: Success
    Artisan-->>Test: NoError
    Test->>FS: Check file.Exists("goravel_darwin")
    FS-->>Test: True
    
    Note over Test: Cleanup in TearDownTest
    Test->>Process: Run("./artisan")
    Process-->>Test: Verify app builds
    Test->>Process: Run("git checkout .")
    Process-->>Test: Reset changes
    Test->>Process: Run("git clean -fd")
    Process-->>Test: Remove untracked files
    Test->>Process: Run("go mod tidy")
    Process-->>Test: Clean dependencies
Loading

@hwbrzzl hwbrzzl marked this pull request as ready for review February 3, 2026 08:26
@hwbrzzl hwbrzzl requested a review from a team as a code owner February 3, 2026 08:26
@hwbrzzl hwbrzzl changed the title chore: add tests for commands chore: add tests for v1.17.1 Feb 3, 2026
@hwbrzzl hwbrzzl marked this pull request as draft February 3, 2026 14:01
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