Skip to content

Commit

Permalink
test: fix slack alerting and mark some tests as flakey (#137)
Browse files Browse the repository at this point in the history
* test: mark resource group test flakey

Temporarily mark the get_by_guid test as flakey due to changes in the API

Signed-off-by: Timothy MacDonald <tim.macdonald@lacework.net>

* test: update test action to properly link to test results

Signed-off-by: Timothy MacDonald <tim.macdonald@lacework.net>

* test: make alert channel get_by_guid test flaky

This test is failing randomly with a 404 error.
Marking flaky for now until the issue can be resolved.

Signed-off-by: Timothy MacDonald <tim.macdonald@lacework.net>

* test: mark some alert channel tests as flaky pending investigation

These randomly fail with a 404 error. More investigation needed.

Signed-off-by: Timothy MacDonald <tim.macdonald@lacework.net>

* test: mark alert channel test flakey

Randomly produces 404 errors. Needs investigation

Signed-off-by: Timothy MacDonald <tim.macdonald@lacework.net>

---------

Signed-off-by: Timothy MacDonald <tim.macdonald@lacework.net>
  • Loading branch information
tmac1973 authored Dec 27, 2023
1 parent da7b2e9 commit 12edf70
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ jobs:
notify_when: "failure"
notification_title: "{workflow} has {status_message}"
message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>"
footer: "Linked Repo <{repo_url}|{repo}> | <{workflow_url}|View Workflow>"
footer: "Linked Repo <{repo_url}|{repo}> | <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Workflow>"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
10 changes: 9 additions & 1 deletion tests/api/v2/test_alert_channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class TestAlertChannels(CrudEndpoint):
OBJECT_ID_NAME = "intgGuid"
OBJECT_TYPE = AlertChannelsAPI

@pytest.mark.flaky_test
def test_api_get_by_guid(self, api_object):
self._get_object_classifier_test(api_object, "guid", self.OBJECT_ID_NAME)

Expand Down Expand Up @@ -77,4 +78,11 @@ def test_api_test(self, api_object):

@pytest.mark.parametrize("api_object", [pytest.lazy_fixture("api_object_org")])
class TestAlertChannelsOrg(TestAlertChannels):
pass

@pytest.mark.flaky_test
def test_api_get_by_guid(self, api_object):
self._get_object_classifier_test(api_object, "guid", self.OBJECT_ID_NAME)

@pytest.mark.flaky_test
def test_api_get_by_type(self, api_object):
self._get_object_classifier_test(api_object, "type")
1 change: 1 addition & 0 deletions tests/api/v2/test_resource_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@ class TestResourceGroups(CrudEndpoint):
OBJECT_TYPE = ResourceGroupsAPI
OBJECT_PARAM_EXCEPTIONS = ["props"]

@pytest.mark.flaky_test
def test_api_get_by_guid(self, api_object):
self._get_object_classifier_test(api_object, "guid", self.OBJECT_ID_NAME)

0 comments on commit 12edf70

Please sign in to comment.