Skip to content

Commit

Permalink
test: additional test fixes and enhancements for agent
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Gammon <[email protected]>
  • Loading branch information
sgammon committed Dec 1, 2023
1 parent edb0585 commit 5b6fa90
Show file tree
Hide file tree
Showing 5 changed files with 521 additions and 353 deletions.
65 changes: 63 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ jobs:
test-agent:
name: "Test: Agent"
runs-on: ${{ matrix.os }}
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
Expand All @@ -148,8 +149,24 @@ jobs:
id: checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0

- name: "Fixup: Directory"
run: mkdir -p /var/tmp/buildless
- name: "Fixup: Directory (Linux/macOS)"
shell: bash
if: matrix.os != 'windows-latest'
run: rm -fr /var/tmp/buildless && mkdir -p /var/tmp/buildless

- name: "Fixup: Directory (Windows)"
shell: bash
if: matrix.os == 'windows-latest'
run: rmdir /c/ProgramData/buildless && mkdir /c/ProgramData/buildless

- name: "Test: Install CLI"
id: test-action-install
uses: ./
with:
agent: false

- name: "Test: Agent Not Installed"
run: test "Agent is not installed." = "$(buildless agent status)" || buildless --verbose=true agent status

- name: "Test: Local Action"
id: test-action
Expand All @@ -164,6 +181,50 @@ jobs:
- name: "Test: Agent Running"
run: test "Agent is installed, running, and ready." = "$(buildless agent status)" || buildless agent status

- name: "Diagnostic: Run Agent in Foreground (Linux/macOS)"
if: (success() || failure()) && matrix.os != 'windows-latest'
run: |
echo ''
ps -aux | grep buildless
echo ''
buildless --verbose=true agent run --no-background
- name: "Report: Agent State (Linux/macOS)"
if: (success() || failure()) && matrix.os != 'windows-latest'
run: |
if [ -f "/var/tmp/buildless/buildless-agent.json" ]; then
echo 'Agent configuration:' && cat /var/tmp/buildless/buildless-agent.json | jq
echo ''
echo 'Contents of tmp path:'
ls -la /var/tmp/buildless
echo ''
echo 'Agent process:'
ps -aux | grep buildless
else
echo 'No agent configuration found. Contents of tmp path:'
ls -la /var/tmp/buildless
fi
- name: "Report: Agent State (Windows)"
if: (success() || failure()) && matrix.os == 'windows-latest'
shell: bash
run: |
if [ -f "/c/ProgramData/buildless/buildless-agent.json" ]; then
echo 'Agent configuration:' && cat /c/ProgramData/buildless/buildless-agent.json | jq
echo ''
echo 'Contents of tmp path:'
ls -la /c/ProgramData/buildless
echo ''
echo 'Agent process:'
ps -aux | grep buildless
else
echo 'No agent configuration found. Contents of tmp path:'
ls -la /c/ProgramData/buildless
echo ''
echo 'Agent process:'
ps -aux | grep buildless
fi
test-noagent:
name: "Test: No Agent"
runs-on: ${{ matrix.os }}
Expand Down
Loading

0 comments on commit 5b6fa90

Please sign in to comment.