Skip to content

Conversation

@ashb
Copy link
Member

@ashb ashb commented Sep 1, 2021

These tests were actually just testing the hook again (by checking the
command executed) but were asserting nothing about the CSV passed to the
hook.

This change makes the operator tests check the logic in the operator and
no longer tests the hook code again.

test_mysql_to_hive_verify_loaded_values was removed as since we
removed Java/a real hive CLI from our tests this has only been testing
our mock, not the real code.


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.

These tests were actually just testing the hook again (by checking the
command executed) but were asserting nothing about the CSV passed to the
hook.

This change makes the operator tests check the logic in the operator and
no longer tests the hook code again.

`test_mysql_to_hive_verify_loaded_values` was removed as since we
removed Java/a real hive CLI from our tests this has only been testing
our mock, not the real code.
Copy link
Member

@uranusjr uranusjr left a comment

Choose a reason for hiding this comment

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

I don’t understand what the old tests are doing and can’t say if the new ones are covering everything they do, but the new tests look good to me.

cur.execute("INSERT INTO baby_names VALUES(%s, %s, %s, %s);", row)

def tearDown(self):
conn.commit()
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
conn.commit()
cur.commit()

?

Copy link
Member Author

Choose a reason for hiding this comment

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

conn.commit does work -- I don't think you commit a cursor.

@github-actions
Copy link

github-actions bot commented Sep 1, 2021

The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest main or amend the last commit of the PR, and push it with --force-with-lease.

@github-actions github-actions bot added the okay to merge It's ok to merge this PR as it does not require more tests label Sep 1, 2021
@ashb
Copy link
Member Author

ashb commented Sep 1, 2021

Yeah, the old tests got nerfed without us really noticing a while ago.

@ashb ashb merged commit 9c19f0d into apache:main Sep 1, 2021
@ashb ashb deleted the mysql-to-hive-op-tests branch September 1, 2021 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers okay to merge It's ok to merge this PR as it does not require more tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants