-
Notifications
You must be signed in to change notification settings - Fork 82
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
Added new elements to delete event #392
Merged
dehort
merged 35 commits into
RedHatInsights:master
from
aleccohan:new_delete_conditions
Aug 27, 2019
Merged
Changes from 2 commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
1095e6e
Added canonical_facts to delete method and HostEvent class
aleccohan 79c48c5
Small Changes to a few files for local development
aleccohan 610227f
changed hack_client.py to not upload multiple chunks
aleccohan 5038067
More small changes to try and setup the local dev enviroment
aleccohan b0d8808
added insights_id to delete event and all canonical facts to HostEven…
aleccohan 4c95079
deleted unecessary comments
aleccohan c046158
removed utils folder containing unecessary tests
aleccohan 08a275c
Added instructions about adding kafka to hosts file to README
aleccohan addc78e
Changed original host_id_to_delete.append() into a dictionary & added…
aleccohan 40f6db1
added additional conditions to DeleteHostsTestCase to test changes to…
aleccohan e6de4f2
Fine tuned tests to work with mac_addresses and ip_addresses
aleccohan a789023
added account to delete method to help with callback to legacy api
aleccohan bc5b827
Merge branch 'new_delete_conditions'
aleccohan d6f8476
tested changes with mock data and removed mock data from events.py
aleccohan 8937269
Merge branch 'master' of https://github.com/RedHatInsights/insights-h…
aleccohan 37ae521
Merge remote-tracking branch 'origin' into added_delete_tests
aleccohan 5595299
Merge branch 'master' of https://github.com/RedHatInsights/insights-h…
aleccohan 8a76897
made suggested changes, used serialization method for not defined can…
aleccohan 4612bf4
ran changes through pre-commit screening & implemented suggestions
aleccohan db47368
Merge branch 'master' of https://github.com/RedHatInsights/insights-h…
aleccohan b2299f0
Merge branch 'master' into new_delete_conditions
aleccohan a698d7f
applied suggestions made, added test for timestamp and type, generate…
aleccohan 1bbf69c
Merged with master
aleccohan d1b46a2
made changes based on feedback
aleccohan 44b99d3
merged added_delete_tests with new_delete_conditions
aleccohan 1af93ce
made suggested changes to test_api.py
aleccohan 8e1892e
Updated changes based on feedback
aleccohan 2dc997b
Merge branch 'new_delete_conditions' of https://github.com/aleccohan/…
aleccohan 05367ff
removed validations from HostEvent(Schema)
aleccohan 355ba89
Added validate back in to match create/update schema
aleccohan fd38720
Fix 500 ERROR and adapt ObjectDeletedError to new code
aleccohan 60025fb
Added request_id to the delete event
aleccohan a2b0c4d
removing validations from Schema
aleccohan c4c01ef
simplified validations to include specified attributes
aleccohan b586b70
fixed Delete event tests in test_api.py
aleccohan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1238,36 +1238,14 @@ def __call__(self, e): | |
timestamp_iso = datetime_mock.utcnow.return_value.isoformat() | ||
|
||
self.assertIsInstance(event, dict) | ||
expected_keys = { | ||
"timestamp", | ||
"type", | ||
"id", | ||
"account", | ||
"insights_id", | ||
"rhel_machine_id", | ||
"subscription_manager_id", | ||
"satellite_id", | ||
"bios_uuid", | ||
"ip_addresses", | ||
"fqdn", | ||
"mac_addresses", | ||
"external_id", | ||
} | ||
expected_keys = {"timestamp", "type", "id", "account", "insights_id", "request_id"} | ||
self.assertEqual(set(event.keys()), expected_keys) | ||
|
||
self.assertEqual(f"{timestamp_iso}+00:00", event["timestamp"]) | ||
self.assertEqual("delete", event["type"]) | ||
self.assertEqual(self.added_hosts[0].id, event["id"]) | ||
self.assertEqual(self.added_hosts[0].insights_id, event["insights_id"]) | ||
self.assertEqual(self.added_hosts[0].rhel_machine_id, event["rhel_machine_id"]) | ||
self.assertEqual(self.added_hosts[0].subscription_manager_id, event["subscription_manager_id"]) | ||
self.assertEqual(self.added_hosts[0].satellite_id, event["satellite_id"]) | ||
self.assertEqual(self.added_hosts[0].bios_uuid, event["bios_uuid"]) | ||
self.assertEqual(self.added_hosts[0].fqdn, event["fqdn"]) | ||
self.assertEqual(self.added_hosts[0].external_id, event["external_id"]) | ||
self.assertEqual(self.added_hosts[0].account, event["account"]) | ||
self.assertEqual(self.added_hosts[0].ip_addresses, event["ip_addresses"]) | ||
self.assertEqual(self.added_hosts[0].mac_addresses, event["mac_addresses"]) | ||
self.assertEqual("-1", event["request_id"]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we test a real forwarded request ID too along with this default unknown one? |
||
|
||
# Try to get the host again | ||
response = self.get(url, 200) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the request ID has a fixed format? Even if so, we probably don’t want to specify it here as we’re only blindly forwarding it.