diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 68b5b4a22..f800535ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -240,7 +240,7 @@ jobs: echo "Screenpipe PID: $CLI_PID" # Wait longer for initialization - sleep 30 + sleep 60 # Check if screenpipe is still running if ! ps -p $CLI_PID > /dev/null; then @@ -296,12 +296,15 @@ jobs: path: . - name: Install FFmpeg - run: choco install ffmpeg -y + run: | + choco install ffmpeg -y + refreshenv - name: Setup and run CLI (Windows) + shell: pwsh run: | # Set up environment - $env:RUST_LOG = "debug" + $env:RUST_LOG = "debug,screenpipe=trace" $env:RUST_BACKTRACE = "1" New-Item -ItemType Directory -Force -Path .\test_data\logs @@ -310,8 +313,8 @@ jobs: $screenpipePID = $screenpipeProcess.Id Write-Output "Screenpipe started with PID: $screenpipePID" - # Wait for screenpipe to start - Start-Sleep -Seconds 20 + # Wait longer for screenpipe to start + Start-Sleep -Seconds 60 # Check if screenpipe is still running $runningProcess = Get-Process -Id $screenpipePID -ErrorAction SilentlyContinue @@ -361,3 +364,10 @@ jobs: Write-Output "Network connections:" netstat -ano | Select-String "3030" exit 1 + + - name: Upload logs + if: failure() + uses: actions/upload-artifact@v3 + with: + name: windows-test-logs + path: .\test_data\logs\* diff --git a/scripts/simulate_audio_activity.ps1 b/scripts/simulate_audio_activity.ps1 index 8f7c249d8..c4e95a601 100644 --- a/scripts/simulate_audio_activity.ps1 +++ b/scripts/simulate_audio_activity.ps1 @@ -1,28 +1,33 @@ Add-Type -AssemblyName System.Speech -$synthesizer = New-Object System.Speech.Synthesis.SpeechSynthesizer - -# Try to set the audio output to the default device try { - $synthesizer.SetOutputToDefaultAudioDevice() -} catch { - Write-Output "Failed to set audio output to default device: $_" - # If setting to default device fails, try to use the first available device - $audioDevices = [System.Speech.Synthesis.SpeechSynthesizer]::InstalledVoices - if ($audioDevices.Count -gt 0) { - $synthesizer.SelectVoice($audioDevices[0].VoiceInfo.Name) - } else { - Write-Output "No audio devices available. Audio simulation will be skipped." - exit - } -} + $synthesizer = New-Object System.Speech.Synthesis.SpeechSynthesizer -while ($true) { + # Try to set the audio output to the default device try { - $synthesizer.SpeakAsync("This is a test of screenpipe CLI audio capture") - Start-Sleep -Seconds 2 + $synthesizer.SetOutputToDefaultAudioDevice() } catch { - Write-Output "Error during speech synthesis: $_" - Start-Sleep -Seconds 5 + Write-Output "Failed to set audio output to default device: $_" + # If setting to default device fails, try to use the first available device + $audioDevices = [System.Speech.Synthesis.SpeechSynthesizer]::InstalledVoices + if ($audioDevices.Count -gt 0) { + $synthesizer.SelectVoice($audioDevices[0].VoiceInfo.Name) + } else { + Write-Output "No audio devices available. Audio simulation will be skipped." + exit + } } + + while ($true) { + try { + $synthesizer.SpeakAsync("This is a test of screenpipe CLI audio capture") + Start-Sleep -Seconds 2 + } catch { + Write-Output "Error during speech synthesis: $_" + Start-Sleep -Seconds 5 + } + } +} catch { + Write-Error "Error in simulate_audio_activity: $_" + exit 1 } \ No newline at end of file diff --git a/scripts/simulate_screen_activity.ps1 b/scripts/simulate_screen_activity.ps1 index f214404a0..e5335d4be 100644 --- a/scripts/simulate_screen_activity.ps1 +++ b/scripts/simulate_screen_activity.ps1 @@ -1,17 +1,22 @@ Add-Type -AssemblyName System.Windows.Forms -while ($true) { - # Simulate mouse movement - for ($i = 0; $i -lt 20; $i++) { - $x = Get-Random -Minimum 0 -Maximum ([System.Windows.Forms.Screen]::PrimaryScreen.Bounds.Width) - $y = Get-Random -Minimum 0 -Maximum ([System.Windows.Forms.Screen]::PrimaryScreen.Bounds.Height) - [System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point($x, $y) - Start-Sleep -Milliseconds 200 - } +try { + while ($true) { + # Simulate mouse movement + for ($i = 0; $i -lt 20; $i++) { + $x = Get-Random -Minimum 0 -Maximum ([System.Windows.Forms.Screen]::PrimaryScreen.Bounds.Width) + $y = Get-Random -Minimum 0 -Maximum ([System.Windows.Forms.Screen]::PrimaryScreen.Bounds.Height) + [System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point($x, $y) + Start-Sleep -Milliseconds 200 + } - # Simulate typing - [System.Windows.Forms.SendKeys]::SendWait("Screenpipe Test Content{ENTER}") - [System.Windows.Forms.SendKeys]::SendWait("This is a test of screenpipe CLI{ENTER}") + # Simulate typing + [System.Windows.Forms.SendKeys]::SendWait("Screenpipe Test Content{ENTER}") + [System.Windows.Forms.SendKeys]::SendWait("This is a test of screenpipe CLI{ENTER}") - Start-Sleep -Seconds 1 + Start-Sleep -Seconds 1 + } +} catch { + Write-Error "Error in simulate_screen_activity: $_" + exit 1 } \ No newline at end of file