@@ -80,6 +80,28 @@ func TestInitRepository(t *testing.T) {
8080 t .Errorf ("Expected copilot instructions file to exist" )
8181 }
8282
83+ // Verify logs .gitignore was created
84+ logsGitignorePath := filepath .Join (tempDir , ".github" , "aw" , "logs" , ".gitignore" )
85+ if _ , err := os .Stat (logsGitignorePath ); os .IsNotExist (err ) {
86+ t .Errorf ("Expected .github/aw/logs/.gitignore file to exist" )
87+ }
88+
89+ // Verify logs .gitignore content
90+ if content , err := os .ReadFile (logsGitignorePath ); err == nil {
91+ contentStr := string (content )
92+ if ! strings .Contains (contentStr , "# Ignore all downloaded workflow logs" ) {
93+ t .Errorf ("Expected .gitignore to contain comment about ignoring logs" )
94+ }
95+ if ! strings .Contains (contentStr , "*" ) {
96+ t .Errorf ("Expected .gitignore to contain wildcard pattern" )
97+ }
98+ if ! strings .Contains (contentStr , "!.gitignore" ) {
99+ t .Errorf ("Expected .gitignore to keep itself" )
100+ }
101+ } else {
102+ t .Errorf ("Failed to read .github/aw/logs/.gitignore: %v" , err )
103+ }
104+
83105 // Verify agentic workflow agent was created
84106 agenticWorkflowAgentPath := filepath .Join (tempDir , ".github" , "agents" , "create-agentic-workflow.agent.md" )
85107 if _ , err := os .Stat (agenticWorkflowAgentPath ); os .IsNotExist (err ) {
@@ -158,6 +180,12 @@ func TestInitRepository_Idempotent(t *testing.T) {
158180 if _ , err := os .Stat (debugAgenticWorkflowAgentPath ); os .IsNotExist (err ) {
159181 t .Errorf ("Expected debug agentic workflow agent file to exist after second call" )
160182 }
183+
184+ // Verify logs .gitignore still exists after second call
185+ logsGitignorePath := filepath .Join (tempDir , ".github" , "aw" , "logs" , ".gitignore" )
186+ if _ , err := os .Stat (logsGitignorePath ); os .IsNotExist (err ) {
187+ t .Errorf ("Expected .github/aw/logs/.gitignore file to exist after second call" )
188+ }
161189}
162190
163191func TestInitRepository_Verbose (t * testing.T ) {
0 commit comments