Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
Signed-off-by: David Anyatonwu <[email protected]>
  • Loading branch information
onyedikachi-david committed Sep 6, 2024
1 parent 577544c commit 7facab8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
25 changes: 19 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,21 +157,22 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y xvfb pulseaudio ffmpeg imagemagick xdotool x11-xserver-utils xterm openbox alsa-utils
Xvfb :99 -ac -screen 0 1024x768 &
Xvfb :99 -ac -screen 0 1024x768x24 &
export DISPLAY=:99
echo "DISPLAY=:99" >> $GITHUB_ENV
sleep 2
sleep 5
openbox &
sleep 2
sleep 5
pulseaudio --start
pactl load-module module-null-sink sink_name=virtual_speaker
pactl set-default-sink virtual_speaker
pactl load-module module-virtual-source source_name=virtual_mic master=virtual_speaker.monitor
pactl set-default-source virtual_mic
sleep 2
sleep 5
xwininfo -root -tree || true
chmod +x ./scripts/launch_test_window.sh
./scripts/launch_test_window.sh &
sleep 5
- name: Simulate screen and audio activity (Ubuntu)
if: matrix.os == 'ubuntu-latest'
Expand All @@ -188,9 +189,15 @@ jobs:
echo "DISPLAY=$DISPLAY"
xdpyinfo || true
DISPLAY=:99 RUST_LOG=debug ./target/release/screenpipe --data-dir ./test_data --fps 1 > screenpipe_output.log 2>&1 &
cat screenpipe_output.log
CLI_PID=$!
sleep 10 # Give CLI some time to start up
for i in {1..24}; do
sleep 10
if ! ps -p $CLI_PID > /dev/null; then
echo "CLI process has died"
cat screenpipe_output.log
exit 1
fi
response=$(curl -s http://localhost:3030/health)
echo "$response"
status=$(echo "$response" | jq -r '.status')
Expand Down Expand Up @@ -230,7 +237,9 @@ jobs:
- name: Run CLI and check health (Windows)
if: matrix.os == 'windows-latest'
run: |
Start-Process -FilePath .\target\release\screenpipe.exe -ArgumentList "--data-dir", ".\test_data" -NoNewWindow
$env:RUST_LOG = "debug"
Start-Process -FilePath .\target\release\screenpipe.exe -ArgumentList "--data-dir", ".\test_data" -NoNewWindow -PassThru -RedirectStandardOutput screenpipe_output.log -RedirectStandardError screenpipe_error.log
Start-Sleep -Seconds 10 # Give CLI some time to start up
Start-Process -FilePath powershell -ArgumentList "-File", ".\scripts\simulate_screen_activity.ps1" -NoNewWindow
Start-Process -FilePath powershell -ArgumentList "-File", ".\scripts\simulate_audio_activity.ps1" -NoNewWindow
$attempts = 24
Expand All @@ -249,7 +258,11 @@ jobs:
}
Write-Output "Current processes:"
Get-Process | Where-Object { $_.Name -match 'screenpipe|powershell' } | Format-Table -AutoSize
Write-Output "Screenpipe log tail:"
Get-Content .\test_data\logs\screenpipe.log -Tail 50
}
Write-Error "Health check failed after 4 minutes"
Get-Content screenpipe_output.log
Get-Content screenpipe_error.log
Get-Content .\test_data\logs\screenpipe.log
exit 1
4 changes: 2 additions & 2 deletions scripts/simulate_screen_activity.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Add-Type -AssemblyName System.Windows.Forms
while ($true) {
# Simulate mouse movement
for ($i = 0; $i -lt 20; $i++) {
$x = Get-Random -Minimum 0 -Maximum 1024
$y = Get-Random -Minimum 0 -Maximum 768
$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
}
Expand Down

0 comments on commit 7facab8

Please sign in to comment.