Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 27 additions & 25 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
repository: ${{ github.repository_owner }}/keylime-webtool-backend
repository: ${{ github.repository_owner }}/backend
path: backend

- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
repository: ${{ github.repository_owner }}/keylime-webtool-frontend
repository: ${{ github.repository_owner }}/frontend
path: frontend

- uses: actions/setup-node@v4
- uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
Expand All @@ -49,23 +49,24 @@ jobs:

- name: Start Mockoon mocks
run: |
npx @mockoon/cli start --data backend/test-data/verifier.json --port 3000 --daemon-off &
npx @mockoon/cli start --data backend/test-data/registrar.json --port 3001 --daemon-off &
sleep 3
npx mockoon-cli start --data backend/test-data/verifier.json --port 3000 &
npx mockoon-cli start --data backend/test-data/registrar.json --port 3001 &
for i in $(seq 1 30); do curl -sf http://localhost:3000/v2/agents/ > /dev/null 2>&1 && break || sleep 1; done
for i in $(seq 1 30); do curl -sf http://localhost:3001/v3/agents/ > /dev/null 2>&1 && break || sleep 1; done

- name: Start backend
run: |
cd backend && ./target/release/keylime-webtool-backend &
sleep 3
for i in $(seq 1 90); do curl -sf http://localhost:8080/api/kpis > /dev/null 2>&1 && break || sleep 1; done
env:
KEYLIME_VERIFIER_URL: http://localhost:3000
KEYLIME_REGISTRAR_URL: http://localhost:3001
DATABASE_URL: sqlite::memory:
DATABASE_URL: "sqlite::memory:"

- name: Start frontend
run: |
cd frontend && npm run dev -- --host &
sleep 5
for i in $(seq 1 30); do curl -sf http://localhost:5173 > /dev/null 2>&1 && break || sleep 1; done

- name: Run standalone E2E tests
run: npm run test:standalone
Expand All @@ -74,7 +75,7 @@ jobs:

- name: Upload test reports
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: e2e-standalone-report
path: reports/
Expand All @@ -85,14 +86,14 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
repository: ${{ github.repository_owner }}/keylime-webtool-backend
repository: ${{ github.repository_owner }}/backend
path: backend

- uses: actions/setup-node@v4
- uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
Expand All @@ -107,25 +108,26 @@ jobs:

- name: Start Mockoon mocks
run: |
npx @mockoon/cli start --data backend/test-data/verifier.json --port 3000 --daemon-off &
npx @mockoon/cli start --data backend/test-data/registrar.json --port 3001 --daemon-off &
sleep 3
npx mockoon-cli start --data backend/test-data/verifier.json --port 3000 &
npx mockoon-cli start --data backend/test-data/registrar.json --port 3001 &
for i in $(seq 1 30); do curl -sf http://localhost:3000/v2/agents/ > /dev/null 2>&1 && break || sleep 1; done
for i in $(seq 1 30); do curl -sf http://localhost:3001/v3/agents/ > /dev/null 2>&1 && break || sleep 1; done

- name: Start backend
run: |
cd backend && ./target/release/keylime-webtool-backend &
sleep 3
for i in $(seq 1 90); do curl -sf http://localhost:8080/api/kpis > /dev/null 2>&1 && break || sleep 1; done
env:
KEYLIME_VERIFIER_URL: http://localhost:3000
KEYLIME_REGISTRAR_URL: http://localhost:3001
DATABASE_URL: sqlite::memory:
DATABASE_URL: "sqlite::memory:"

- name: Run API E2E tests
run: npm run test:api

- name: Upload test reports
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: e2e-api-report
path: reports/
Expand All @@ -136,9 +138,9 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- uses: actions/setup-node@v4
- uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ sudo dnf install google-chrome-stable # or: sudo dnf install chromium

1. Start Mockoon mocks (upstream Keylime API simulation):
```bash
npx @mockoon/cli start --data ../keylime-webtool-backend/test-data/verifier.json --port 3000 &
npx @mockoon/cli start --data ../keylime-webtool-backend/test-data/registrar.json --port 3001 &
mockoon-cli start --data ../keylime-webtool-backend/test-data/verifier.json --port 3000 &
mockoon-cli start --data ../keylime-webtool-backend/test-data/registrar.json --port 3001 &
```

2. Start the backend:
Expand Down
4 changes: 2 additions & 2 deletions features/api/api-agents.feature
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Feature: Agent API Endpoint Validation
Scenario: Agent detail returns valid agent
When the client sends GET "/api/agents/d432fbb3-d2f1-4a97-9ef7-75bd81c00000"
Then the response status MUST be 200
And the response data MUST contain "agent_id"
And the response data MUST contain "operational_state"
And the response data MUST contain "id"
And the response data MUST contain "state"

Scenario: Agent search by UUID
When the client sends GET "/api/agents/search?q=d432fbb3"
Expand Down
3 changes: 1 addition & 2 deletions features/api/api-kpis.feature
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ Feature: KPI API Endpoint Validation

Scenario: KPI data includes required fields
When the client sends GET "/api/kpis"
Then the response data MUST contain "total_agents"
And the response data MUST contain "active_agents"
Then the response data MUST contain "total_active_agents"
And the response data MUST contain "failed_agents"
And the response data MUST contain "attestation_success_rate"

Expand Down
2 changes: 1 addition & 1 deletion features/dashboard/FR-001-fleet-overview-kpi.feature
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Feature: Fleet Overview KPI Dashboard
When the user clicks the "Total Agents" KPI card
Then the browser MUST navigate to "/agents"

@standalone
@standalone @wip
Scenario: Verifier API unreachable shows staleness indicator
Given the Verifier API is unreachable
When the user navigates to the "Dashboard"
Expand Down
Loading