Skip to content

Conversation

@tukanos
Copy link

@tukanos tukanos commented Sep 4, 2025

Adding a platform testing code. It will make life easier for Magritte testing.

@tukanos tukanos force-pushed the platformIdentification branch 2 times, most recently from b5914e7 to 26f6af4 Compare September 8, 2025 08:39
@jbrichau
Copy link
Member

We're trying to avoid this kind of method but I do acknowledge that it is often very handy to have. So, let's add it to Grease.

However, Grease is also on the Squeak and VAST platforms (the code for the last one is not in this repo, but it exists). So I would prefer to list all supported platforms. Doing the check in this way means it will break silently when a class name changes. Although unlikely, I would like to recommend an implementation as follows:

GRPlatform>>#isGemStone, GRPlatform>>#isPharo, GRPlatform>>#isSqueak, GRPlatform>>#isVAST
^ false

GRPharoPlatform>>#isPharo
^ true

GRGemStonePlatform>>#isGemStone
^ true

GRGemStonePlatformTest>>testIsGemStone

self assert: GRPlatform current isGemStone.
self deny: GRPlatform current isPharo.
self deny: GRPlatform current isSqueak

The important thing here is that if we add it to Grease, it is expected to exist on all platforms and work. So, a test on each platform will need to be added.

@tukanos tukanos force-pushed the platformIdentification branch from 26f6af4 to 8ebbf69 Compare September 19, 2025 12:03
@codecov
Copy link

codecov bot commented Sep 19, 2025

Codecov Report

❌ Patch coverage is 89.74359% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.79%. Comparing base (a1954f8) to head (2d98f90).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
...-Core.package/GRPlatform.class/instance/isPharo.st 0.00% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #190   +/-   ##
=======================================
  Coverage   86.78%   86.79%           
=======================================
  Files        1860     1869    +9     
  Lines       12797    12840   +43     
=======================================
+ Hits        11106    11144   +38     
- Misses       1691     1696    +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tukanos
Copy link
Author

tukanos commented Sep 19, 2025

Funny is that my first/second commit was similar to what you wanted. I wanted to reduce the number of methods so I got fancy :). I have created the patch in a way that should now work for everyone.

I have also send PR for the information which dialects are consuming Grease.

@tukanos tukanos force-pushed the platformIdentification branch 2 times, most recently from 850a312 to 9739fc2 Compare September 19, 2025 12:41
@tukanos tukanos force-pushed the platformIdentification branch 2 times, most recently from 2c846f1 to c159455 Compare September 29, 2025 09:12
@tukanos tukanos force-pushed the platformIdentification branch from c159455 to 2d98f90 Compare September 29, 2025 09:18
@tukanos
Copy link
Author

tukanos commented Oct 2, 2025

@jbrichau The failing test testFromStringThreeDigit in Pharo14 does not relate to tested code. Perhaps issue with test stability?

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