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 class name in reports #104

Closed
wants to merge 1 commit into from
Closed

Conversation

MSP-Greg
Copy link
Contributor

@MSP-Greg MSP-Greg commented Feb 5, 2018

No description provided.

@thomthom
Copy link
Member

thomthom commented Feb 6, 2018

Can you elaborate on what this fixes? What was observed before and what is observed afterwards?

@MSP-Greg
Copy link
Contributor Author

MSP-Greg commented Feb 6, 2018

Sorry. Using current minitest, reports don't report the test class, they list Minitest::Result. Or, reports look like:

Minitest::Result#test_add_classification_incorrect_number_of_arguments_one = 0.65 s = .
Minitest::Result#test_get_classification_value_string = 0.68 s = .
Minitest::Result#test_get_classification_value_incorrect_number_of_arguments_zero = 0.68 s = .

After the patch, they look like:

TC_Sketchup_Image#test_explode = 0.04 s = .
TC_Sketchup_Image#test_explode_incorrect_number_of_arguments_one = 0.03 s = .
TC_Sketchup_Image#test_image_rep_too_many_arguments = 0.03 s = .

Thanks, Greg

Note: Below I've attached a script (su_gem.rb.txt, rename su_gem.rb) that allow one to easily perform Gem operations from the SU console. See notes in file. Four issues:

  1. Gems that require compiling normally shell out to another Ruby instance. Since SU does not include 'ruby.exe', they cannot be build / installed.

  2. Some gems add binary files (Puma, Rake, RubyGems, Thin, etc) that can be used from the command line. I haven't checked to see how these install, as sometimes that requires UI action from the user.

  3. --user-install can be done, but, at present, SU cannot access the folder. I do have a patch for that if anyone's interested.

  4. Not required, but I would recommend updating RubyGems, which does involve a few steps.

For a RubyGems command reference, see here.

su_gem.rb.txt

@thomthom
Copy link
Member

thomthom commented Feb 6, 2018

Will this patch impact older version of Minitest?

@MSP-Greg
Copy link
Contributor Author

MSP-Greg commented Feb 6, 2018

Will this patch impact older version of Minitest?

Yes. Sorry.

I just checked in 2016 with 5.4.3. Long story, but Minitest doesn't tag the repo with versions, so checking things version by version is a PITA. The Result class was added in v5, so I assumed 5.4.3 had the klass attribute. It does not. I'll update the PR...

Greg

@@ -75,7 +75,10 @@ def report

def record(result)
super
io.puts "%s#%s = %.2f s = %s" % [result.class,
unless instance_variable_defined? :@has_klass
Copy link
Member

Choose a reason for hiding this comment

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

The logic in these two files are duplicated. I think it would be ideal if this was put into a Mix-in module that could reuse the logic across both reporters. And along with a comment that explains why this is being done the way it is.

Copy link
Contributor Author

@MSP-Greg MSP-Greg Mar 9, 2018

Choose a reason for hiding this comment

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

I'll be looking at some Minitest stuff later. Minitest 5.11.3 (current) does not have a Ruby version constraint, and I believe this PR is due to testup-2 using an old version (not 100% sure).

Should we/you just update the Minitest version used (and skip the reporter changes)?

Copy link
Member

Choose a reason for hiding this comment

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

I got an issue logged to look into the Minitest version. I'm spinning up on TestUp2 work, so I'll get back to this shortly.

I don't recall why a newer version of MiniTest didn't work previously. I might have never found the real cause of it. So will have to see how the latest version fares.

@MSP-Greg
Copy link
Contributor Author

MSP-Greg commented Jan 8, 2024

Closing in favor of #217

@MSP-Greg MSP-Greg closed this Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants