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

Fix unittest related to the dir hash in MacOS #1329

Open
tatiana opened this issue Nov 15, 2024 · 1 comment
Open

Fix unittest related to the dir hash in MacOS #1329

tatiana opened this issue Nov 15, 2024 · 1 comment
Labels
area:testing Related to testing, like unit tests, integration tests, etc

Comments

@tatiana
Copy link
Collaborator

tatiana commented Nov 15, 2024

Feedback from https://github.com/astronomer/astronomer-cosmos/pull/1322/files#r1842807048

Just fyi: I'm on macOS (so Darwin) and I had to change 25beeb54cc4eeabe6198248e286a1cfe in line 1582 to 6f63493009733a7be34364a6ea3ffd3c (= the value in line 1584) in my local repo in order to get the unit test to pass.
astronomer-cosmos/tests/dbt/test_graph.py

Lines 1581 to 1584 in 8ec46d2

	 if sys.platform == "darwin": 
	     assert hash_dir == "25beeb54cc4eeabe6198248e286a1cfe" 
	 else: 
	     assert hash_dir == "6f63493009733a7be34364a6ea3ffd3c" 
@dosubot dosubot bot added the area:testing Related to testing, like unit tests, integration tests, etc label Nov 15, 2024
@tatiana
Copy link
Collaborator Author

tatiana commented Nov 15, 2024

As a reference, on my MacBook I got the following error when running hatch run tests.py3.10-2.7:test-cov:

FAILED tests/dbt/test_graph.py::test_save_dbt_ls_cache - AssertionError: assert '400457eb6664cd604a1af9e06c07a620' == '25beeb54cc4eeabe6198248e286a1cfe'
  
  - 25beeb54cc4eeabe6198248e286a1cfe
  + 400457eb6664cd604a1af9e06c07a620

The version of python and other local configuration may affect the value of this test locally. The important part is to guarantee that for a given environment, if it is run twice, it will return the same value. We can probably refactor the test so it is more deterministic when devs run it locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:testing Related to testing, like unit tests, integration tests, etc
Projects
None yet
Development

No branches or pull requests

1 participant