Skip to content

use name on in/outlets when available instead of label #2

use name on in/outlets when available instead of label

use name on in/outlets when available instead of label #2

Workflow file for this run

---
name: Run Tests
on:
workflow_dispatch:
pull_request:
jobs:
testing_single_pdu:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.19
- name: Testing
run: |
mkdir -p out/build && go build -o ./out/build ./cmd/...
mkdir -p ./log
go run ./cmd/raritan-stub --port ${PORT} -u ${USERNAME} -p ${PASSWORD} -v 2 &> ./log/stub.log &
sleep 2
go run ./cmd/exporter -a "http://localhost:${PORT}" -u ${USERNAME} -p ${PASSWORD} -i ${INTERVAL} --metrics -v 2 &> ./log/exporter.log &
sleep 5
curl -s http://localhost:2112/metrics | tee ./log/exporter.out
SUCCESS=$?
pkill raritan-stub
pkill exporter
exit $SUCCESS
env:
PORT: 3000
USERNAME: test
PASSWORD: test
INTERVAL: 5
- name: Gather logs
uses: actions/upload-artifact@v3
with:
name: logs-single-pdu
path: |
./log/
testing_multi_pdu:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.19
- name: Testing
run: |
mkdir -p out/build && go build -o ./out/build ./cmd/...
mkdir -p ./log
go run ./cmd/raritan-stub --port 3001 -u ${USERNAME} -p ${PASSWORD} --pdu-name pdu01 -v 2 &> ./log/stub-pdu01.log &
go run ./cmd/raritan-stub --port 3002 -u ${USERNAME} -p ${PASSWORD} --pdu-name pdu02 -v 2 &> ./log/stub-pdu02.log &
go run ./cmd/raritan-stub --port 3003 -u ${USERNAME} -p ${PASSWORD} --pdu-name pdu03 -v 2 &> ./log/stub-pdu03.log &
go run ./cmd/raritan-stub --port 3004 -u ${USERNAME} -p ${PASSWORD} --pdu-name pdu04 -v 2 &> ./log/stub-pdu04.log &
go run ./cmd/raritan-stub --port 3005 -u ${USERNAME} -p ${PASSWORD} --pdu-name pdu05 -v 2 &> ./log/stub-pdu05.log &
tee -a config.yaml > /dev/null <<EOT
---
port: 2112
metrics: true
pdu_config:
- name: pdu01
address: "http://localhost:3001"
username: ${USERNAME}
password: ${PASSWORD}
- name: pdu02
address: "http://localhost:3002"
username: ${USERNAME}
password: ${PASSWORD}
- name: pdu03
address: "http://localhost:3003"
username: ${USERNAME}
password: ${PASSWORD}
- name: pdu04
address: "http://localhost:3004"
username: ${USERNAME}
password: ${PASSWORD}
- name: pdu05
address: "http://localhost:3005"
username: ${USERNAME}
password: ${PASSWORD}
EOT
go run ./cmd/exporter -i ${INTERVAL} -c ./config.yaml --metrics -v 2 &> ./log/exporter.log &
sleep 5
curl -s http://localhost:2112/metrics | tee ./log/exporter.out
SUCCESS=$?
pkill raritan-stub
pkill exporter
exit $SUCCESS
env:
USERNAME: test
PASSWORD: test
INTERVAL: 5
- name: Gather logs
uses: actions/upload-artifact@v3
with:
name: logs-multi-pdu
path: |
./log/
./config.yaml