Skip to content

test: some suggestions for making failing test file more readable#10

Open
maelle wants to merge 3 commits intomasterfrom
tests
Open

test: some suggestions for making failing test file more readable#10
maelle wants to merge 3 commits intomasterfrom
tests

Conversation

@maelle
Copy link
Member

@maelle maelle commented Sep 30, 2024

👋 @quishqa!

I don't know yet why the Windows build is failing (I am on Ubuntu and can't run the tests locally yet see #9) however I think this test file can be made more informative when it fails by using more specific expectations. Some of them might be new to you, I think going over https://testthat.r-lib.org/reference/index.html once in a while is useful as new expectations appear over time (it's useful for me at least!).

Anyway as a summary:

  • no need to explicitly load the internal data.
  • I had trouble understanding the failure param_means["ws"] > 1 (actual) not equal to param_means["ws"] < 2 (expected)., using expect_lt() and expect_gt() instead will give a clearer failure.
  • I'd recommend moving the expectations around the class of pinheiros and its columns before the calculations.
  • These expectations around classes should use https://testthat.r-lib.org/reference/inheritance-expectations.html although for the columns I have added a comment, I think it'd make sense to create the vector of all class names then use expect_setequal() https://testthat.r-lib.org/reference/expect_setequal.html (it does not check the order of columns).

@maelle
Copy link
Member Author

maelle commented Sep 30, 2024

Now it's failing everywhere, clearly I did something wrong. Happy to run the tests locally once I have more instructions 🙈

@maelle
Copy link
Member Author

maelle commented Feb 7, 2025

@quishqa friendly reminder 😸

@quishqa
Copy link
Collaborator

quishqa commented Feb 17, 2025

Hi @maelle!
Sorry for the late answer, I'm back to maintaining qualR 🦾 .

  • By looking the commits, I think the errors are happening by removing the internal data which contains an example credential to test the functions (probably not a good practice).
  • I agree using expect_lt, expect_gt, expect_<class> functions, it produce a cleaner code.
    I believe I do need to read again testthat documentation 😞

@maelle
Copy link
Member Author

maelle commented Feb 17, 2025

Don't hesitate to ping me to ask any question!

@maelle
Copy link
Member Author

maelle commented Apr 29, 2025

@quishqa any help needed? 😸

@maelle
Copy link
Member Author

maelle commented Oct 7, 2025

@quishqa any update or help needed? 😸

@quishqa
Copy link
Collaborator

quishqa commented Oct 13, 2025

Hi @maelle, sorry for the delay. I think the error happens because in 5ca83eb the deleted file has the credentials to log in and download the data...

@maelle
Copy link
Member Author

maelle commented Oct 14, 2025

Do you need to cache/mock some stuff?

@maelle
Copy link
Member Author

maelle commented Nov 7, 2025

@quishqa any update / any help needed?

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

Comments