• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

FlexMeasures / flexmeasures / 23806253080
78%

Build:
DEFAULT BRANCH: main
Ran 31 Mar 2026 03:55PM UTC
Jobs 1
Files 163
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

31 Mar 2026 03:44PM UTC coverage: 77.794% (+0.09%) from 77.702%
23806253080

push

github

web-flow
Add POST endpoints for creating annotations on accounts, assets, and sensors (#1968)

* Initial plan

* Add annotation API endpoints for accounts, assets, and sensors

Co-authored-by: Flix6x <30658763+Flix6x@users.noreply.github.com>

* Fix API issues: add response schema, fix idempotency, add error handling

Co-authored-by: Flix6x <30658763+Flix6x@users.noreply.github.com>

* Remove temporary API review file

* tests(api/dev): add comprehensive tests for annotation API endpoints

Context:
- Issue #470 implements new POST endpoints for annotations on accounts, assets, and sensors
- New endpoints at /api/dev/annotation/{accounts,assets,sensors}/<id>
- Endpoints use AnnotationSchema for validation and return AnnotationResponseSchema
- Implements idempotent behavior (201 for new, 200 for existing)

Tests added:
- Permission validation for all three endpoints (accounts, assets, sensors)
  - Tests account-admin, platform admin, regular users, and cross-account access
  - Verifies 403 Forbidden for unauthorized access and 401 for no auth
- Validation error handling:
  - Missing required fields (content, start, end)
  - Invalid type enum values
  - Content exceeding 1024 characters
  - End time before or equal to start time
- Idempotency test (201 first, 200 second with same data)
- 404 Not Found for non-existent entities
- Valid annotation type enum values (alert, holiday, label, feedback, warning, error)
- Default type value (label)
- Optional belief_time field
- Response schema validation (all expected fields present)
- Comprehensive test covering all three endpoints together
- Verification that annotations are correctly linked to entities

Test coverage:
- 17 test functions covering all requirements from issue #470
- Uses setup_api_fresh_test_data fixture for database isolation
- Follows existing FlexMeasures test patterns from v3_0 API tests
- All tests parametrized appropriately for comprehensive coverage

* Add comprehensive documentation for annotati... (continued)

81 of 92 new or added lines in 9 files covered. (88.04%)

11575 of 14879 relevant lines covered (77.79%)

0.78 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
5
45.45
-0.7% flexmeasures/api/v3_0/__init__.py
6
80.85
-11.25% flexmeasures/utils/doc_utils.py
Jobs
ID Job ID Ran Files Coverage
1 23806253080.1 31 Mar 2026 03:55PM UTC 163
77.79
GitHub Action Run
Source Files on build 23806253080
  • Tree
  • List 163
  • Changed 11
  • Source Changed 8
  • Coverage Changed 11
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #23806253080
  • 30d3057d on github
  • Prev Build on main (#23790681427)
  • Next Build on main (#23855489763)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc