-
Notifications
You must be signed in to change notification settings - Fork 9
72 lines (58 loc) · 2.14 KB
/
Copy pathdevnet-test.yml
File metadata and controls
72 lines (58 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
name: Devnet Integration Test
on:
push:
branches: ["main"]
paths: ["devnet/**", ".github/workflows/devnet-test.yml"]
pull_request:
branches: ["main"]
paths: ["devnet/**", ".github/workflows/devnet-test.yml"]
workflow_dispatch:
jobs:
test:
name: Devnet Integration Test
runs-on: ubuntu-latest
defaults:
run:
working-directory: devnet
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Init (crypto + genesis block)
run: make init
- name: Start Org1
run: make start
- name: Create namespace
run: make init-namespace-org1
- name: Stop (volumes preserved)
run: make stop
- name: Start both orgs
run: make start-both
- name: Verify namespace persists
run: |
output=$(make list-namespaces)
echo "$output"
count=$(echo "$output" | grep -c ") mynamespace:")
[ "$count" -eq 1 ] || { echo "Expected 1 namespace, found $count"; exit 1; }
- name: Verify no exited or unhealthy containers
run: |
exited=$(docker ps -a --filter label=com.docker.compose.project=fabric-x --filter status=exited -q)
[ -z "$exited" ] || { echo "Exited containers detected:"; docker ps -a; exit 1; }
unhealthy=$(docker ps --filter label=com.docker.compose.project=fabric-x --filter health=unhealthy -q)
[ -z "$unhealthy" ] || { echo "Unhealthy containers detected:"; docker ps; exit 1; }
- name: Purge
run: make purge
- name: Verify all containers removed
run: |
remaining=$(docker ps --filter label=com.docker.compose.project=fabric-x -q)
[ -z "$remaining" ] || { echo "Containers still running after purge:"; docker ps; exit 1; }
- name: Dump logs on failure
if: failure()
run: |
docker ps -a
docker compose -f compose.yaml -f compose.org2.yaml logs --tail=100 2>/dev/null || true
docker compose -f compose.test-committer.yaml logs --tail=100 2>/dev/null || true