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

[AIRFLOW-5740] Fix Transient failure in Slack test #6407

Merged
merged 2 commits into from
Oct 24, 2019
Merged

Conversation

kaxil
Copy link
Member

@kaxil kaxil commented Oct 24, 2019

The transient failure is caused by Dict Ordering

Make sure you have checked all steps below.

Jira

Description

  • Here are some details about my PR, including screenshots of any UI changes:

Change Slack test so that it does Equality check regardless of order

7) FAIL: test_build_slack_message (tests.contrib.hooks.test_slack_webhook_hook.TestSlackWebhookHook)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/airflow/tests/contrib/hooks/test_slack_webhook_hook.py", line 109, in test_build_slack_message
    self.assertEqual(self.expected_message, message)
AssertionError: '{"ic[188 chars]k", "channel": "#general", "blocks": [{"type":[109 chars]: 1}' != '{"ic[188 chars]k", "username": "SlackMcSlackFace", "blocks": [109 chars]: 1}'
- {"icon_emoji": ":hankey:", "icon_url": "https://airflow.apache.org/_images/pin_large.png", "attachments": [{"fallback": "Required plain-text summary"}], "text": "Awesome message to put on Slack", "channel": "#general", "blocks": [{"type": "section", "text": {"type": "mrkdwn", "text": "*bold text*"}}], "username": "SlackMcSlackFace", "link_names": 1}
?                                                                                                                                                                                                      ^^^^^^^^^^^^^^^^^^^^^                                                                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ {"icon_emoji": ":hankey:", "icon_url": "https://airflow.apache.org/_images/pin_large.png", "attachments": [{"fallback": "Required plain-text summary"}], "text": "Awesome message to put on Slack", "username": "SlackMcSlackFace", "blocks": [{"type": "section", "text": {"type": "mrkdwn", "text": "*bold text*"}}], "channel": "#general", "link_names": 1}
?                    

Changing from using assertEqual to assertCountEqual. THe backport should contain assertItemsEqual (for Py2)

Tests

  • My PR adds the following unit tests OR does not need testing for this extremely good reason:

Commits

  • My commits all reference Jira issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "How to write a good git commit message":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters (not including Jira issue reference)
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

Documentation

  • In case of new functionality, my PR adds documentation that describes how to use it.
    • All the public functions and the classes in the PR contain docstrings that explain what it does
    • If you implement backwards incompatible changes, please leave a note in the Updating.md so we can assign it to a appropriate release

The transient failure is caused by Dict Ordering
@kaxil kaxil requested review from ashb and dimberman October 24, 2019 10:31
We were comparing strings
@kaxil
Copy link
Member Author

kaxil commented Oct 24, 2019

Fixed the test. The actual problem was we were comparing strings.

I have changed it to compare dicts.

@Fokko Fokko merged commit 401003e into master Oct 24, 2019
@Fokko Fokko deleted the AIRFLOW-5740 branch October 24, 2019 17:35
kaxil added a commit that referenced this pull request Dec 14, 2019
* [AIRFLOW-5740] Fix Transient failure in Slack test

The transient failure is caused by Dict Ordering

* We were comparing string

We were comparing strings

(cherry picked from commit 401003e)
kaxil added a commit that referenced this pull request Dec 14, 2019
* [AIRFLOW-5740] Fix Transient failure in Slack test

The transient failure is caused by Dict Ordering

* We were comparing string

We were comparing strings

(cherry picked from commit 401003e)
kaxil added a commit that referenced this pull request Dec 17, 2019
* [AIRFLOW-5740] Fix Transient failure in Slack test

The transient failure is caused by Dict Ordering

* We were comparing string

We were comparing strings

(cherry picked from commit 401003e)
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.

5 participants