mirror of
https://github.com/Lifailon/lazyjournal.git
synced 2026-11-11 01:09:46 +01:00
update opt for interface testing
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user