Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
jonlamb-gh committed Feb 14, 2024
1 parent 86c4d52 commit ba0c8b9
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 9 deletions.
36 changes: 27 additions & 9 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
name: Integration Tests
on: [push, workflow_dispatch]

# TODO - add option for stable/nightly channel
on:
push:
workflow_dispatch:
inputs:
package_channel:
description: 'Modality package channel (stable/nightly)'
required: true
default: 'nightly'
type: choice
options:
- stable
- nightly

env:
MODALITY_URL: "http://localhost:14181/v1"
Expand All @@ -12,7 +21,7 @@ jobs:
demo:
name: Run, collect, and test
timeout-minutes: 30
runs-on: ubuntu-22.04
runs-on: ubuntu-20.04
steps:
- name: Print Environment
run: |
Expand All @@ -24,6 +33,7 @@ jobs:
echo "GITHUB_ACTOR=$GITHUB_ACTOR"
echo "GITHUB_REF=$GITHUB_REF"
echo "GITHUB_SHA=$GITHUB_SHA"
echo "PACKAGE_CHANNEL=${{inputs.package_channel}}"
docker --version
- name: Checkout Sources
Expand Down Expand Up @@ -70,6 +80,10 @@ jobs:
- name: Start Modality server
run: |
image="ghcr.io/auxoncorp/modalityd-nightly:latest"
if [ "${{inputs.package_channel}}" == "stable" ]; then
image="ghcr.io/auxoncorp/modalityd:latest"
fi
mkdir -p modalityd_data
docker run \
--name modalityd \
Expand All @@ -80,9 +94,9 @@ jobs:
-e NO_TLS=Y \
-d --rm \
ghcr.io/auxoncorp/modalityd-nightly:latest
docker logs modalityd
curl --retry-max-time 30 --retry 10 --retry-connrefused ${{env.MODALITY_URL}}/alive
docker logs modalityd
- name: Setup initial Modality configuration
run: |
Expand Down Expand Up @@ -115,17 +129,21 @@ jobs:
- name: Start Modality Reflector
working-directory: test_system
run: |
image="ghcr.io/auxoncorp/modality-reflector-nightly:latest"
if [ "${{inputs.package_channel}}" == "stable" ]; then
image="ghcr.io/auxoncorp/modality-reflector:latest"
fi
docker run \
--name reflector \
--network=host \
-e MODALITY_HOST=localhost \
-e INGEST_PROTOCOL_PARENT_URL="modality-ingest://127.0.0.1" \
-e MUTATION_PROTOCOL_PARENT_URL="modality-mutation://127.0.0.1" \
-v "/usr/lib/modality-reflector-plugins:/usr/lib/modality-reflector-plugins" \
-v "$(pwd)/reflector-config.toml:/reflector-config.toml" \
-e MODALITY_AUTH_TOKEN="${{env.MODALITY_AUTH_TOKEN}}" \
-e REFLECTOR_OPTS='--config /reflector-config.toml --collector trace-recorder-tcp' \
-e REFLECTOR_OPTS="--config /reflector-config.toml --collector trace-recorder-tcp" \
-d --rm \
ghcr.io/auxoncorp/modality-reflector-nightly:latest
docker logs reflector
${image}
- name: Run the system
working-directory: test_system
Expand Down
2 changes: 2 additions & 0 deletions test_system/scripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ set -euo pipefail
make emulate
)

sleep 1

modality internal sync-indices

exit 0
10 changes: 10 additions & 0 deletions test_system/specs/device.speqtr
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,16 @@ behavior "Control Cycle"
adc @ Sensor
end

recovery case "a higher priority context is activated"
adc
FOLLOWED BY
QUEUE_SEND @ Sensor (_.queue = "adc_queue")
FOLLOWED BY
TASK_READY @ Sensor (_.task != "Actuator") as other_task
FOLLOWED BY
TASK_ACTIVATE @ * (_.timeline.name = other_task.task AND _.priority > 2)
end

nominal case "program execution follows the control cycle expectations"
adc
FOLLOWED BY
Expand Down

0 comments on commit ba0c8b9

Please sign in to comment.