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

Inverse Reporting - Shows whats not changed #15

Merged
merged 3 commits into from
Apr 23, 2024

Conversation

jyejare
Copy link
Member

@jyejare jyejare commented Apr 17, 2024

A new feature where the comparison could be done for what's not changed.

The new -i or --inverse option to show whats not changed.

# candore compare -i -t csv -o results.csv --pre pre_entities.json --post post_entities.json
Wrote CSV report to results.csv
CSV report contains 23049 results

Also, Expected constants similar as expected variations implemented (Needs additional 6_15_constants.yaml file with expected data):

# candore compare -i -t csv -o results.csv --pre pre_entities.json --post post_entities.json
Wrote CSV report to results.csv
CSV report contains 23011 results

Could also record the expected variations if you need that in report (Needs additional 6_15_constants.yaml file with expected data)

# candore compare --record-evs -i -t csv -o results.csv --pre pre_entities.json --post post_entities.json
Wrote CSV report to results.csv
CSV report contains 23049 results

@jyejare jyejare self-assigned this Apr 17, 2024
@jyejare jyejare force-pushed the inverse_compare branch 2 times, most recently from 7edca55 to 3e4ef20 Compare April 19, 2024 12:38
@JacobCallahan
Copy link
Member

Looks like I ran into an issue when running this locally (unrelated to the changes here).

$ candore compare -i -t csv -o results.csv --pre pre_report --post post_report
...
  File "/home/jake/Programming/candore/candore/modules/comparator.py", line 80, in _is_data_type_dict
    self.compare_all_pres_with_posts(pre[key], post[key], unique_key=key)
  File "/home/jake/Programming/candore/candore/modules/comparator.py", line 133, in compare_all_pres_with_posts
    self._is_data_type_list(pre_data, post_data, unique_key=unique_key)
  File "/home/jake/Programming/candore/candore/modules/comparator.py", line 119, in _is_data_type_list
    if sorted(pre, key=custom_key) != sorted(post, key=custom_key):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '<' not supported between instances of 'int' and 'str'

When looking at the vars there, I see something likely unexpected for pre and post

In [1]: pre                                                                                                                                                                                   
Out[1]: [None, 1]                                                                                                                                                                             
                                                                                                                                                                                              
In [2]: post                                                                                                                                                                                  
Out[2]: [None, 1]       

@jyejare jyejare force-pushed the inverse_compare branch 3 times, most recently from a89b7e2 to 058466d Compare April 20, 2024 08:53
@jyejare
Copy link
Member Author

jyejare commented Apr 22, 2024

@JacobCallahan I had similar issue during the implementation but it was related to int and None.

TypeError: '<' not supported between instances of 'int' and none.

@jyejare
Copy link
Member Author

jyejare commented Apr 22, 2024

@JacobCallahan Yeah having None is the data is something interesting but no worries I got you covered with fix in commit - 885109f

Could you please retry now ?

@JacobCallahan
Copy link
Member

@jyejare that allowed the report to complete!

@jyejare
Copy link
Member Author

jyejare commented Apr 22, 2024

Glad that works for you @JacobCallahan , Thanks !

@jyejare jyejare merged commit ad7b965 into SatelliteQE:master Apr 23, 2024
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.

2 participants