Skip to content

ITEP-89829 - Automate tests for scene retrack functionality#1278

Merged
saratpoluri merged 39 commits into
mainfrom
sbel/retrack-object
May 1, 2026
Merged

ITEP-89829 - Automate tests for scene retrack functionality#1278
saratpoluri merged 39 commits into
mainfrom
sbel/retrack-object

Conversation

@sbelhaik
Copy link
Copy Markdown
Contributor

@sbelhaik sbelhaik commented Apr 2, 2026

📝 Description

Automate tests for scene retrack functionality
JIRA: ITEP-89829

✨ Type of Change

Select the type of change your PR introduces:

  • 🐞 Bug fix – Non-breaking change which fixes an issue
  • 🚀 New feature – Non-breaking change which adds functionality
  • 🔨 Refactor – Non-breaking change which refactors the code base
  • 💥 Breaking change – Changes that break existing functionality
  • 📚 Documentation update
  • 🔒 Security update
  • 🧪 Tests
  • 🚂 CI

🧪 Testing Scenarios

Describe how the changes were tested and how reviewers can test them too:

  • ✅ Tested manually
  • 🤖 Ran automated end-to-end tests

✅ Checklist

Before submitting the PR, ensure the following:

  • 🔍 PR title is clear and descriptive
  • 📝 For internal contributors: If applicable, include the JIRA ticket number (e.g., ITEP-123456) in the PR title. Do not include full URLs
  • 💬 I have commented my code, especially in hard-to-understand areas
  • 📄 I have made corresponding changes to the documentation
  • ✅ I have added tests that prove my fix is effective or my feature works

@sbelhaik sbelhaik requested a review from Copilot April 2, 2026 15:01
@sbelhaik sbelhaik marked this pull request as ready for review April 2, 2026 15:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new functional test suite to validate scene retrack behavior when linking a child scene (Demo) to a newly created parent scene, and wires it into the functional test Makefile target.

Changes:

  • Add retrack-object functional test target to run the new retrack test module.
  • Introduce tc_scene_retrack.py with multiple retrack scenarios (retrack on/off and toggle), validating regulated-topic propagation and object ID behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 12 comments.

File Description
tests/Makefile.functional Adds a retrack-object target that runs the new retrack functional test with the standard compose stack and controller auth secret.
tests/functional/tc_scene_retrack.py New functional tests that create/link scenes, toggle retrack via REST, publish camera detections via MQTT, and assert parent/child regulated outputs and ID semantics.

Comment thread tests/functional/tc_scene_retrack.py Outdated
Comment thread tests/functional/tc_scene_retrack.py Outdated
Comment thread tests/functional/tc_scene_retrack.py Outdated
Comment thread tests/functional/tc_scene_retrack.py
Comment thread tests/functional/tc_scene_retrack.py Outdated
Comment thread tests/functional/tc_scene_retrack.py Outdated
Comment thread tests/functional/tc_scene_retrack.py
Comment thread tests/functional/tc_scene_retrack.py
Comment thread tests/functional/tc_scene_retrack.py
Comment thread tests/functional/tc_scene_retrack.py
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

Comment thread tests/functional/tc_scene_retrack.py Outdated
Comment thread tests/functional/tc_scene_retrack.py Outdated
Comment thread tests/functional/tc_scene_retrack.py Outdated
Comment thread tests/Makefile.functional Outdated
Copy link
Copy Markdown
Contributor

@saratpoluri saratpoluri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still reviewing

Comment thread tests/functional/tc_scene_retrack.py Outdated
Comment thread tests/functional/tc_scene_retrack.py Outdated
Comment thread tests/functional/tc_scene_retrack.py Outdated
Comment thread tests/functional/tc_scene_retrack.py Outdated
@sbelhaik sbelhaik force-pushed the sbel/retrack-object branch from 2000349 to fda8d8b Compare April 20, 2026 13:37
@sbelhaik sbelhaik requested a review from Copilot April 21, 2026 08:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 12 comments.

Comments suppressed due to low confidence (1)

tests/functional/common_retrack.py:1

  • publish_data() mutates the obj_data fixture in-place (timestamp, bounding box, category). If objData is not function-scoped (or is reused by other tests), this can leak state across tests and cause order-dependent failures. Consider copying the dict (e.g., deep copy) inside publish_data()/publish_timed() before mutating, or constructing a per-publish payload object.
#!/usr/bin/env python3

Comment thread tests/functional/common_retrack.py Outdated
Comment thread tests/functional/common_retrack.py
Comment thread tests/functional/common_retrack.py Outdated
Comment thread tests/functional/common_retrack.py Outdated
Comment thread tests/functional/common_retrack.py
Comment thread tests/functional/common_retrack.py
Comment thread tests/functional/common_retrack.py
Comment thread tests/functional/tc_scene_retrack.py Outdated
Comment thread tests/functional/tc_scene_retrack.py Outdated
Comment thread tests/functional/tc_scene_retrack.py Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

Comment thread tests/Makefile.functional Outdated
Comment thread tests/functional/tc_scene_retrack.py
Comment thread tests/functional/tc_scene_retrack.py
Comment thread tests/functional/common_retrack.py Outdated
@saratpoluri
Copy link
Copy Markdown
Contributor

@copilot address all comments

…ons, rate restore

Agent-Logs-Url: https://github.com/open-edge-platform/scenescape/sessions/0b75b5cc-da4f-4742-9222-356eb858e628

Co-authored-by: saratpoluri <1325325+saratpoluri@users.noreply.github.com>
auto-merge was automatically disabled April 30, 2026 23:26

Head branch was pushed to by a user without write access

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 30, 2026

@copilot address all comments

Addressed all open comments in 99cb43d:

  • Removed duplicate SECRETSDIR restore in Makefile.functional
  • Added assert verify['count'] > 0 in set_retrack() before indexing results
  • Added assert scene_data.statusCode == 200 before using scene_data in the rate-limiting test
  • Changed teardown to use h.set_external_rate() so the controller gets the DB notification before the scene is torn down
  • Improved teardown_scenes() with error-level logging, res.errors surfacing, and per-operation exception handling

Comment thread tests/functional/tc_scene_retrack.py Outdated
Comment thread tests/functional/tc_scene_retrack.py
@saratpoluri
Copy link
Copy Markdown
Contributor

@copilot fix all review comments

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 30, 2026

@copilot fix all review comments

Done in eed57c4 — removed the redundant propagation test (NEX-T10536) and rewrote the toggle test to start with retrack=True using continuous publishing, observe new UUIDs, then toggle to retrack=False and observe preserved IDs.

@saratpoluri saratpoluri merged commit ea230a7 into main May 1, 2026
31 checks passed
@saratpoluri saratpoluri deleted the sbel/retrack-object branch May 1, 2026 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants