Skip to content

Propagate deviceNumId through to ClearBlade (#726) #8283

Propagate deviceNumId through to ClearBlade (#726)

Propagate deviceNumId through to ClearBlade (#726) #8283

Workflow file for this run

name: UDMI test suite
on:
push:
workflow_dispatch:
pull_request:
schedule:
- cron: '0 13 * * *'
concurrency:
group: ci-${{ github.repository }}
cancel-in-progress: true
jobs:
udmis:
name: UDMIS Tests
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
timeout-minutes: 10
env:
PUSH_REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
GITHUB_REF: ${{ github.ref }}
steps:
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Checkout source
uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-tags: true
- name: bin/run_tests install_dependencies
run: bin/run_tests install_dependencies
- name: bin/start_pubsub
run: bin/start_pubsub
- name: bin/test_mosquitto
run: bin/test_mosquitto
- name: bin/run_tests udmis_tests
run: bin/run_tests udmis_tests
- name: test output
if: ${{ always() }}
run: more out/test_* | cat
- name: Log in to the github registry
uses: docker/login-action@v2
with:
registry: ${{ env.PUSH_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup udmis container build
if: ${{ github.event_name == 'push' }}
run: |
revhash=$(git rev-parse $GITHUB_REF)
IMAGE_TAG=g${revhash:0:9}
PUSH_REPO=$PUSH_REGISTRY/${{ github.repository }}
PUSH_TAG=$PUSH_REPO:$IMAGE_TAG
echo PUSH_TAG=$PUSH_TAG >> $GITHUB_ENV
udmis/bin/container prep --no-check ${PUSH_REPO%/*}
echo Pushing built container as $PUSH_TAG | tee -a $GITHUB_STEP_SUMMARY
- name: Build and push docker image
if: ${{ github.event_name == 'push' }}
uses: docker/build-push-action@v4
with:
file: udmis/Dockerfile.udmis
context: udmis
push: true
tags: ${{ env.PUSH_TAG }}
unit:
name: Unit Tests
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Checkout source
uses: actions/checkout@v3
- name: bin/run_tests all_tests
run: bin/run_tests all_tests
- name: all test output
if: ${{ always() }}
run: more out/test_* | cat
spelling:
name: Docs Spelling Checks
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- uses: actions/checkout@v3
- name: Check Spelling
uses: rojopolis/[email protected]
with:
config_path: .spellcheck.yml
task_name: Markdown
clearblade:
name: ClearBlade Integration
runs-on: ubuntu-latest
if: vars.CLEARBLADE_PROJECT != ''
env:
CLEARBLADE_PROJECT: ${{ vars.CLEARBLADE_PROJECT }}
UDMI_REFLECTOR_ENDPOINT: ${{ vars.UDMI_REFLECTOR_ENDPOINT }}
UDMI_PUBBER_ENDPOINT: ${{ vars.UDMI_PUBBER_ENDPOINT }}
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: bin/run_tests install_dependencies
run: bin/run_tests install_dependencies
- name: bin/test_regclean $CLEARBLADE_PROJECT
run: bin/test_regclean $CLEARBLADE_PROJECT
- name: sequencer run
run: |
bin/sequencer -v out/cloud_iot_config-reflect.json $CLEARBLADE_PROJECT AHU-1 213978213 system_last_update
fgrep "RESULT fail system system_last_update" out/sequencer.out
- name: Config outputs
if: ${{ always() }}
run: |
more /tmp/pubber_config.json out/cloud_iot_config-reflect.json | cat
udmif:
name: UDMIF unit tests
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.16.0
- name: Install Angular CLI
run: npm install -g @angular/cli
- name: web tests
run: udmif/web/runTests
- name: api tests
run: udmif/api/runTests
sequencer:
name: Sequencer Suite
runs-on: ubuntu-latest
timeout-minutes: 35
if: vars.GCP_TARGET_PROJECT != '' && vars.UDMI_REGISTRY_SUFFIX != ''
env:
GCP_TARGET_PROJECT: ${{ vars.GCP_TARGET_PROJECT }}
UDMI_REGISTRY_SUFFIX: ${{ vars.UDMI_REGISTRY_SUFFIX }}
UDMI_ALT_REGISTRY: ${{ vars.UDMI_ALT_REGISTRY }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: base setup
run: bin/run_tests install_dependencies
- name: registrar clean
run: bin/test_regclean //gcp/$GCP_TARGET_PROJECT
- name: sequence tests clean
run: bin/test_sequencer clean $GCP_TARGET_PROJECT
- name: sequence tests alpha
run: bin/test_sequencer alpha $GCP_TARGET_PROJECT
- name: sequence test timing
if: ${{ always() }}
run: fgrep ' ending test ' out/sequencer.log
- name: generated files
if: ${{ always() }}
run: more out/sequencer.out out/generated.md || true
- name: sequencer end state
if: ${{ always() }}
run: cat sites/udmi_site_model/out/sequencer_AHU-1.json || true
- name: schema validation output
if: ${{ always() }}
run: |
echo ============ out/schemas.out
cat out/schemas.out || true
echo ============ find RESULT.log
find sites/udmi_site_model/out/devices/ -name RESULT.log | xargs fgrep -i schema
- name: sequencer markdown report generator
if: ${{ always() }}
run: |
SAMPLE_TEST_ROW="| system | system_last_update | stable | pass | Sequence complete |"
echo Checking for entry in generated results.md
grep "$SAMPLE_TEST_ROW" sites/udmi_site_model/out/devices/AHU-1/results.md
- name: pubber logs
if: ${{ always() }}
run: more out/pubber.out* pubber/out/*/*.json || true
- name: output logs
if: ${{ always() }}
run: cd sites/udmi_site_model/out && more `find . -type f` || true
- name: support bundle
if: ${{ always() }}
run: |
bin/support
mv /tmp/udmi-support_*.tgz ${{ github.repository_owner }}_${{ github.job }}_$(cd /tmp; ls udmi-support_*.tgz)
echo Renamed support file to `ls *_udmi-support_*.tgz`
- uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
if-no-files-found: error
name: udmi-support_${{ github.run_id }}
path: '*_udmi-support_*.tgz'
sequencer_dep:
name: Sequencer Suite
runs-on: ubuntu-latest
timeout-minutes: 35
needs: redirect
if: vars.GCP_TARGET_PROJECT != '' && vars.UDMI_REGISTRY_SUFFIX == ''
env:
GCP_TARGET_PROJECT: ${{ vars.GCP_TARGET_PROJECT }}
UDMI_ALT_REGISTRY: ${{ vars.UDMI_ALT_REGISTRY }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: base setup
run: bin/run_tests install_dependencies
- name: registrar clean
run: bin/test_regclean //gcp/$GCP_TARGET_PROJECT
- name: sequence tests clean
run: bin/test_sequencer clean $GCP_TARGET_PROJECT
- name: sequence tests alpha
run: bin/test_sequencer alpha $GCP_TARGET_PROJECT
- name: sequence test timing
if: ${{ always() }}
run: fgrep ' ending test ' out/sequencer.log
- name: generated files
if: ${{ always() }}
run: more out/sequencer.out out/generated.md || true
- name: sequencer end state
if: ${{ always() }}
run: cat sites/udmi_site_model/out/sequencer_AHU-1.json || true
- name: schema validation output
if: ${{ always() }}
run: |
echo ============ out/schemas.out
cat out/schemas.out || true
echo ============ find RESULT.log
find sites/udmi_site_model/out/devices/ -name RESULT.log | xargs fgrep -i schema
- name: pubber logs
if: ${{ always() }}
run: more out/pubber.out* pubber/out/*/*.json || true
- name: output logs
if: ${{ always() }}
run: cd sites/udmi_site_model/out && more `find . -type f` || true
- name: support bundle
if: ${{ always() }}
run: |
bin/support
mv /tmp/udmi-support_*.tgz ${{ github.repository_owner }}_${{ github.job }}_$(cd /tmp; ls udmi-support_*.tgz)
echo Renamed support file to `ls *_udmi-support_*.tgz`
- uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
if-no-files-found: error
name: udmi-support_${{ github.run_id }}
path: '*_udmi-support_*.tgz'
comprehensive:
name: Comprehensive Suite
runs-on: ubuntu-latest
timeout-minutes: 30
if: vars.GCP_TARGET_PROJECT != ''
env:
GCP_TARGET_PROJECT: ${{ vars.GCP_TARGET_PROJECT }}
UDMI_ALT_REGISTRY: ${{ vars.UDMI_ALT_REGISTRY }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: base setup
run: bin/run_tests install_dependencies
- name: registrar clean
run: |
bin/test_regclean //gcp/$GCP_TARGET_PROJECT
- name: telemetry validator
run: |
bin/test_validator $GCP_TARGET_PROJECT
- name: validator result
if: ${{ always() }}
run: |
cat /tmp/validator.out || true
- name: message captures
if: ${{ always() }}
run: |
cd sites/udmi_site_model/out
find . -type f | sort | xargs more | cat
- name: itemized sequencer tests
run: |
bin/test_itemized $GCP_TARGET_PROJECT
- name: itemized output logs
if: ${{ always() }}
run: |
more out/test_itemized.out out/schemas_itemized.out | cat
more out/sequencer.out-* out/pubber.out-* | cat
- name: tool output logs
if: ${{ always() }}
run: |
more sites/udmi_site_model/out/*.json | cat
- name: pubber output logs
if: ${{ always() }}
run: |
more out/pubber.out* | cat
- name: support bundle
if: ${{ always() }}
run: |
bin/support
mv /tmp/udmi-support_*.tgz ${{ github.repository_owner }}_${{ github.job }}_$(cd /tmp; ls udmi-support_*.tgz)
echo Renamed support file to `ls *_udmi-support_*.tgz`
- uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
if-no-files-found: error
name: udmi-support_${{ github.run_id }}
path: '*_udmi-support_*.tgz'
redirect:
name: Endpoint Redirection
runs-on: ubuntu-latest
needs: comprehensive
timeout-minutes: 10
if: vars.GCP_TARGET_PROJECT != ''
env:
GCP_TARGET_PROJECT: ${{ vars.GCP_TARGET_PROJECT }}
UDMI_ALT_REGISTRY: ${{ vars.UDMI_ALT_REGISTRY }}
MQTT_PROXY_HOST: ${{ vars.MQTT_PROXY_HOST }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: base setup
run: bin/run_tests install_dependencies
- name: bin/test_proxy
if: "${{ env.MQTT_PROXY_HOST != '' }}"
run: |
bin/test_proxy $GCP_TARGET_PROJECT $MQTT_PROXY_HOST
- name: bin/test_redirect
run: |
bin/test_redirect $GCP_TARGET_PROJECT
- name: pubber.out.1
run: |
echo ::::::: pubber.out.1
cat out/pubber.out.1
- name: pubber.out.2
run: |
echo ::::::: pubber.out.2
cat out/pubber.out.2