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 unit test #22

Merged
merged 1 commit into from
Sep 25, 2020
Merged

Add unit test #22

merged 1 commit into from
Sep 25, 2020

Conversation

sofiasyria
Copy link
Contributor

@sofiasyria sofiasyria commented Sep 4, 2020

@sofiasyria sofiasyria changed the title Add Unit test [WIP] Add Unit test Sep 4, 2020
@sofiasyria sofiasyria force-pushed the unit_test branch 2 times, most recently from 495fb4c to 93f8d2b Compare September 4, 2020 13:37
@sofiasyria sofiasyria changed the title [WIP] Add Unit test [WIP] Add unit test Sep 7, 2020
@sofiasyria sofiasyria force-pushed the unit_test branch 6 times, most recently from 13b4c0d to 10a68e8 Compare September 8, 2020 11:26
spec/OneClickInstall_spec.rb Outdated Show resolved Hide resolved
.rspec Show resolved Hide resolved
spec/OneClickInstall_spec.rb Show resolved Hide resolved
spec/OneClickInstall_spec.rb Outdated Show resolved Hide resolved
spec/OneClickInstall_spec.rb Show resolved Hide resolved
spec/OneClickInstall_spec.rb Show resolved Hide resolved
@sofiasyria sofiasyria force-pushed the unit_test branch 2 times, most recently from 534f13f to 51872bc Compare September 18, 2020 14:22
Copy link
Member

@mvidner mvidner left a comment

Choose a reason for hiding this comment

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

Thanks for the tests Sofia!

Please don't hesitate to ping us for more reviews.

Rakefile Outdated
@@ -8,3 +8,9 @@ Yast::Tasks.configuration do |conf|
conf.install_locations["desktop/*"] = File.join(Packaging::Configuration::DESTDIR, "/usr/share/applications/")
conf.install_locations["mime/*"] = File.join(Packaging::Configuration::DESTDIR, "/usr/share/mime/packages/")
end

# This is required, because `yast-travis-ruby` binary calls `rake test:unit`
Copy link
Member

Choose a reason for hiding this comment

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

rake -W will show that "test:unit" is already defined in https://github.com/yast/yast-rake/blob/613cdb654d963a9acd8e35439ddaa1125857345c/lib/tasks/test_unit.rake#L54
The catch is that for historical reasons it expects the directory to be named test, not spec.

Until yast-rake resolves this it would be probably best to symlink test -> spec here and remove this task, then both rspec and rake test:unit will work.

Copy link
Member

Choose a reason for hiding this comment

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

yast-rake is also where we declare --format documentation in a common place

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In that case I will change the name of the file from spec to test etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm.. ok. I created a symlink instead, your solution was much simpler. About the "--format documentation" should I move it to the rake file instead?

ENV["LANG"] = "en_US.UTF-8"

# load it early, so other stuffs are not ignored
if ENV["COVERAGE"]
Copy link
Member

Choose a reason for hiding this comment

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

Yay!

If we also add /coverage/ to top level .gitignore, the CI check should go green again

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@mvidner
Copy link
Member

mvidner commented Sep 23, 2020

On the subject of single or double quotes around strings: double quotes win.

We have a YaST Ruby style, https://github.com/yast/yast-devtools/blob/4dcb03ac7e4816a4f858534163393767d52df5fb/ytools/y2tool/rubocop-0.71.0_yast_style.yml#L35 , which is enforced by RuboCop in the "major" repositories. We deviate in some points from the "community ruby style", double quotes being the most visible point.

@jreidinger
Copy link
Member

I think it looks good now. So lets merge it and solve other improvements as another pull requests.

@jreidinger jreidinger merged commit f372327 into yast:master Sep 25, 2020
@yast-bot
Copy link
Contributor

✔️ Public Jenkins job #11 successfully finished

@yast-bot
Copy link
Contributor

✔️ Internal Jenkins job #5 successfully finished

@sofiasyria sofiasyria changed the title [WIP] Add unit test Add unit test Jan 11, 2021
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