update opt for interface testing

This commit is contained in:
Lifailon
2025-02-26 13:21:52 +03:00
parent bd78b99dd8
commit 63e8b2a7eb
2 changed files with 18 additions and 12 deletions
+5 -10
View File
@@ -29,18 +29,13 @@ on:
default: true
type: boolean
testFunctions:
description: 'Testing functions and performance'
description: 'Go test function'
default: true
type: boolean
testInterface:
description: 'Testing interface'
description: 'Interface testing in TMUX'
default: true
type: boolean
Timeout:
description: 'Timeout for interface testing'
required: true
default: 5
type: number
jobs:
build:
@@ -97,14 +92,14 @@ jobs:
if: ${{ github.event.inputs.testInterface == 'true' && github.event.inputs.Distro == 'macos-15' }}
run: brew install tmux
- name: Interface testing
- name: Interface testing in TMUX
if: ${{ github.event.inputs.testInterface == 'true' }}
run: |
tmux -V
chmod +x test.sh
bash test.sh ${{ github.event.inputs.Timeout }} true
bash test.sh 5 true
- name: Go test functions
- name: Go test function
if: ${{ github.event.inputs.testFunctions == 'true' }}
run: |
sudo go test -v
+13 -2
View File
@@ -3,7 +3,7 @@
# bash test.sh <timeout> <log>
# bash test.sh 3 true
timeout=${1:-5}
timeout=${1:-5} # default timeout 5 seconds
debug=$2
exitCode=0
@@ -35,7 +35,7 @@ if [ "$journalctlVersion" == "false" ]; then
else
tmux send-keys -t test-session "cron"
tmux send-keys -t test-session "$(echo -e '\t')"
tmux send-keys -t test-session "$(echo -e '\x1b[C')"
tmux send-keys -t test-session "$(echo -e '\x1b[C')"
start_time=$(date +%s)
while true; do
@@ -77,6 +77,17 @@ tmux send-keys -t test-session "input"
tmux send-keys -t test-session "$(echo -e '\t\t')"
tmux send-keys -t test-session "$(echo -e '\x1b[C')"
start_time=$(date +%s)
while true; do
current_time=$(date +%s)
elapsed=$((current_time - start_time))
if [[ $(tmux capture-pane -p | grep -q "< Optional p") && $(tmux capture-pane -p | grep -q -v "Searching") ]] || [ "$elapsed" -ge "$timeout" ]; then
break
fi
done
tmux send-keys -t test-session "$(echo -e '\x1b[C')"
start_time=$(date +%s)
while true; do
current_time=$(date +%s)