Skip to content

Tests and CI: Locale.US fix for TTS, unit tests for core logic, GitHub Actions workflow #1

Tests and CI: Locale.US fix for TTS, unit tests for core logic, GitHub Actions workflow

Tests and CI: Locale.US fix for TTS, unit tests for core logic, GitHub Actions workflow #1

name: Nightscout Follower Tests
on:
push:
branches: [feat-rob, main]
paths:
- 'Common/src/test/java/tk/glucodata/drivers/nightscout/**'
- 'Common/src/main/java/tk/glucodata/drivers/nightscout/**'
- '.github/workflows/nightscout-follower-tests.yml'
pull_request:
branches: [feat-rob, main]
paths:
- 'Common/src/test/java/tk/glucodata/drivers/nightscout/**'
- 'Common/src/main/java/tk/glucodata/drivers/nightscout/**'
workflow_dispatch:
jobs:
nightscout-follower-unit-tests:
name: NightscoutFollowerRegistry Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-nsftests-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-nsftests-
- name: Run Nightscout Follower Registry tests
run: |
./gradlew :Common:testMobileLibre3SiDexGoogleDebugUnitTest \
--tests "tk.glucodata.drivers.nightscout.*" \
--no-daemon \
--warning-mode=all
- name: Upload test report
if: always()
uses: actions/upload-artifact@v4
with:
name: nightscout-follower-test-report
path: |
Common/build/reports/tests/testMobileLibre3SiDexGoogleDebugUnitTest/
Common/build/test-results/testMobileLibre3SiDexGoogleDebugUnitTest/
# Runs on a schedule: every 30 minutes during working hours
# Keeps the feature rock-solid through iterative testing.
# The schedule can be adjusted or triggered manually.
nightscout-follower-iterative-test:
name: Iterative Nightscout Follower Tests (30min)
runs-on: ubuntu-latest
# Run every 30 minutes between 06:00 and 22:00 UTC
# Cron: "*/30 6-22 * * *" — disabled by default; enable via workflow_dispatch or uncomment
# schedule:
# - cron: "*/30 6-22 * * *"
# Uncomment the line below and use workflow_dispatch to trigger manually,
# or enable the schedule above for automated iterative testing.
# For now we leave it as workflow_dispatch only.
if: github.event_name == 'workflow_dispatch'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-nsftests-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-nsftests-
- name: Run full unit test suite for nightscout follower
run: |
./gradlew :Common:testMobileLibre3SiDexGoogleDebugUnitTest \
--tests "tk.glucodata.drivers.nightscout.*" \
--rerun-tasks \
--no-daemon
- name: Upload test report
if: always()
uses: actions/upload-artifact@v4
with:
name: iterative-test-report-${{ github.run_number }}
path: |
Common/build/reports/tests/testMobileLibre3SiDexGoogleDebugUnitTest/
Common/build/test-results/testMobileLibre3SiDexGoogleDebugUnitTest/