Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed CI/CD Tests for Edge-Endpoint #70

Merged
merged 46 commits into from
Jul 8, 2024
Merged

Fixed CI/CD Tests for Edge-Endpoint #70

merged 46 commits into from
Jul 8, 2024

Conversation

honeytung
Copy link
Member

This PR contains the following changes to fix CI/CD tests failing:

  • Updates Groundlight SDK version from 0.13.1 to 0.17.0
  • Updates FrameGrab from 0.4.3 to 0.5.0
  • Fixed tests from motion-detection not passing

As a side note, for future improvements it might be better if we can either make sure the tests also passed for edge-endpoint if we update the SDK, or use a matching sdk tests for the sdk version the edge-endpoint is running if we are not updating edge's sdk version that often.

Copy link
Collaborator

@brandon-groundlight brandon-groundlight left a comment

Choose a reason for hiding this comment

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

The test might just be flaky, but I'd like to see the motion detection test pass, not just skip, before we update the edge-endpoint here

@@ -21,7 +21,7 @@ kubernetes = "^27.2.0"
jinja2 = "^3.1.2"
SQLAlchemy = "2.0.22"
APScheduler = "3.10.4"
groundlight = "^0.13.1"
groundlight = "^0.17.0"
Copy link
Collaborator

Choose a reason for hiding this comment

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

This makes me happy

@@ -240,28 +240,40 @@ def test_motion_detection_not_sufficient_if_doesnt_meet_conf_threshold(gl: Groun
detector_id = DETECTORS["dog_detector"]["detector_id"]
detector = gl.get_detector(id=detector_id)

# Set detector confidence threshold to 0.90
gl.update_detector_confidence_threshold(detector.id, 0.90)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is just to restore the detector to a known state, because we might change it in a previous test run?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, the purpose of this test is to try to see if the motion detector, even when there is no motion detected, will escalated to the cloud if the detector confidence threshold changed to a higher value than the first IQ's confidence.

if new_response.result is None or new_response.result.confidence is None or new_response.result.confidence > 0.95:
# Revert the confidence threshold to 0.90
gl.update_detector_confidence_threshold(detector.id, 0.90)
pytest.skip("This test requires that the cached image query response has a confidence < 0.95")
Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks like this test skipped when you ran it, I'm not sure if we'll get to the following assertion which is the meat of what we're testing here. Is there a way to make this more reliable? Is it just a matter of raising the confidence even higher?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yea @tyler-romero and I found out that the test originally was made based on a misunderstanding of the SDK that the confidence_threshold will be forwarded to the API.

Since it is polling the client, it will just timeout if the original IQ is already high enough. The test right now using the dog detector can already achieved a confidence of 0.98.

If we want to make this test working for most scenarios, I can try to raise it to 0.99 with a wait time long enough to trigger a cloud labeler to respond.

@honeytung
Copy link
Member Author

After discussion with @tyler-romero, the test that failed is created from a SDK implementation misunderstanding of the confidence threshold will forward to the API (confidence threshold is a client only polling). Thus, it is safe for this test case to be removed.

Copy link
Collaborator

@brandon-groundlight brandon-groundlight left a comment

Choose a reason for hiding this comment

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

I'm on board with removing that test too

confidence=confidence,
label=label,
),
patience_time=30.0,
Copy link
Member

Choose a reason for hiding this comment

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

Was there a specific reason to add this? It should be taken as an argument to create_iqe and the true requested patience_time should be set here from post_image_query

Copy link
Member Author

Choose a reason for hiding this comment

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

Yea I added when I was doing some testing and forget to add to post_image_query. Will add it back.

Copy link
Member

@tyler-romero tyler-romero left a comment

Choose a reason for hiding this comment

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

LGTM, one minor comment

@honeytung honeytung merged commit a506ef5 into main Jul 8, 2024
@honeytung honeytung deleted the cicd-fix branch July 8, 2024 22:07
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.

3 participants