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

Add some tests #1395

Merged
merged 24 commits into from
Jul 26, 2022
Merged

Add some tests #1395

merged 24 commits into from
Jul 26, 2022

Conversation

qwerty287
Copy link
Contributor

Try to increase test coverage by adding some (partially useless) tests.

@codecov
Copy link

codecov bot commented Jul 3, 2022

Codecov Report

Merging #1395 (2876dcd) into master (89fcba4) will increase coverage by 0.71%.
The diff coverage is n/a.

tests/Feature/LangTest.php Show resolved Hide resolved
tests/Feature/SearchTest.php Outdated Show resolved Hide resolved
tests/Feature/SearchTest.php Show resolved Hide resolved
tests/Feature/SettingsTest.php Show resolved Hide resolved
@ildyria
Copy link
Member

ildyria commented Jul 20, 2022

I would wait for #1403 as it changes Legacy quite a lot and some of those code may already have changed.

Copy link
Contributor

@nagmat84 nagmat84 left a comment

Choose a reason for hiding this comment

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

I had a look at the changes since my last review. Everything fine so far except the one open comment which can only be closed after #1351. Except from that I am fine with the PR.

However, it would be possible to even improve on this PR further (not I "must", only something which crossed my mind). The tests for the search feature only check whether the uploaded photo is found. There are no negative tests, i.e. that an uploaded photo which does not match the search criteria is not found. This means a silly implementation of the search feature which always simply returns the whole DB without actually searching anything would also pass the tests. Hence, what I would have done is to upload two photos in each of the tests, e.g. the Night photo and the Mongolia photo, search and check that the search result only contains one element and the correct element. But I also understand that this might be out of the scope of this PR. I am already happy that we have more tests.

@nagmat84
Copy link
Contributor

However, it would be possible to even improve on this PR further (not I "must", only something which crossed my mind). The tests for the search feature only check whether the uploaded photo is found. There are no negative tests [...]

Added negative tests myself in e5d042a.

@nagmat84 nagmat84 self-requested a review July 24, 2022 10:55
@nagmat84
Copy link
Contributor

I would wait for #1403 as it changes Legacy quite a lot and some of those code may already have changed.

@ildyria I assume you are speaking about the changes introduces by this PR in f732f5d?

I am not sure why @qwerty287 made this part of this PR. To me these changes seem unrelated to the purpose of this PR. I assume if f732f5d was reverted, then the only changes introduced by this PR are more tests and the PR is fine for merge, right?

@ildyria
Copy link
Member

ildyria commented Jul 24, 2022

@ildyria I assume you are speaking about the changes introduces by this PR in f732f5d?

Yes.

@nagmat84
Copy link
Contributor

@qwerty287 Do you mind to revert f732f5d? I am not sure if this should be part of this PR at all and it will be mostly outdated after #1403. Without this commit, we could merge this PR right away.

@qwerty287
Copy link
Contributor Author

This is not related to the tests. But I noticed that these methods will always return the same result. The removed methods noLogin and SetPassword return always false (due to the version check). Thus I removed them and their usages. I can revert it in a few days.

@qwerty287
Copy link
Contributor Author

qwerty287 commented Jul 26, 2022

@nagmat84 @ildyria Reverted.

@ildyria ildyria merged commit 1064f04 into master Jul 26, 2022
@ildyria ildyria deleted the tests branch July 26, 2022 15:06
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.

None yet

3 participants