Pharo test defects

Package: Launchpad (ba-st/Launchpad, row 14)

State
Fixed (package repair)
Defect in
see the record
Tests
0
Fix
ba-st-launchpad.st, ba-st-launchpad.patch
Upstream repository
ba-st/Launchpad

The record is the text of the repair. The Results table is the last run of the row.

Record

Test

Load the package into a Pharo 14 image (build 791) with the load expression of the test run, file in the fixes file of the row if there is one, and run the test classes of the package.

"row 14"
Metacello new baseline: 'Launchpad'; repository: 'github://ba-st/Launchpad:release-candidate/source'; onConflict: [:e | e useIncoming]; load: #('default').

Results

Last result of the package run (stock Cog and iospharo on the same image).

RowLabelLoadStock Cogiospharo VM
14ba-st-launchpadoktests=123 P=123 F=0 E=0 S=0 T=0 X=0tests=123 P=123 F=0 E=0 S=0 T=0 X=0

Fix

Fixes file (filed in after the load): ba-st-launchpad.st (download)
"Launchpad (ba-st/Launchpad, release-candidate), test helper of Buoy:
Buoy-Metaprogramming-Pharo-Extensions defines OSPlatform>>environmentAt:put:,
environmentAt:ifPresent:ifAbsent: and removeEnvironmentKey: with 'self
environment'.  OSPlatform>>environment is deprecated in Pharo 14 (the method is
in Deprecated14) and its message says 'Use OSEnvironment current instead'.
LaunchpadRootCommandTest>>set:to:during: and ConfigurationFromEnvironmentProviderTest
call these three methods, so a Deprecation reaches the test (seen:
testHandlingStartGreeterApplicationWithMixedConfiguration).  The three methods
answer through OSEnvironment current, which is what 'environment' answers.
The same change belongs in Buoy (see docs/upstream/package-repairs.md)."

fix value: #OSPlatform value: #environmentAt:ifPresent:ifAbsent:
	value: [ :source | source includesSubstring: 'self environment' ]
	value:
'environmentAt: aVariableName ifPresent: aBlock ifAbsent: anAbsentBlock

	^ OSEnvironment current
		  at: aVariableName
		  ifPresent: aBlock
		  ifAbsent: anAbsentBlock'.

fix value: #OSPlatform value: #environmentAt:put:
	value: [ :source | source includesSubstring: 'self environment' ]
	value:
'environmentAt: variableName put: value

	OSEnvironment current at: variableName put: value'.

fix value: #OSPlatform value: #removeEnvironmentKey:
	value: [ :source | source includesSubstring: 'self environment' ]
	value:
'removeEnvironmentKey: variableName

	OSEnvironment current removeKey: variableName'.
Patch of the package source: ba-st-launchpad.patch (download)
diff --git a/source/BaselineOfLaunchpad/BaselineOfLaunchpad.class.st b/source/BaselineOfLaunchpad/BaselineOfLaunchpad.class.st
index 09660c5..fd34bb3 100644
--- a/source/BaselineOfLaunchpad/BaselineOfLaunchpad.class.st
+++ b/source/BaselineOfLaunchpad/BaselineOfLaunchpad.class.st
@@ -43,6 +43,12 @@ BaselineOfLaunchpad >> baseline: spec [
   spec for: #'pharo13.x' do: [
       self setUpPharo11Packages: spec.
       spec preLoadDoIt: #closeWelcomeWindow
+    ].
+  spec for: #'pharo14.x' do: [
+      self
+        setUpPharo11Packages: spec;
+        setUpPharo14Packages: spec.
+      spec preLoadDoIt: #closeWelcomeWindow
     ]
 ]
 
@@ -184,6 +190,15 @@ BaselineOfLaunchpad >> setUpPharo11Packages: spec [
 		group: 'Tools' with: 'Launchpad-Development-Tools'
 ]
 
+{ #category : 'baselines' }
+BaselineOfLaunchpad >> setUpPharo14Packages: spec [
+
+	spec
+		package: 'Launchpad-Pharo14-Compatibility';
+		group: 'Deployment' with: 'Launchpad-Pharo14-Compatibility';
+		group: 'Tests' with: 'Launchpad-Pharo14-Compatibility'
+]
+
 { #category : 'baselines' }
 BaselineOfLaunchpad >> setUpSUnitPackages: spec [
 
diff --git a/source/Launchpad-Pharo14-Compatibility/CommandLineArguments.extension.st b/source/Launchpad-Pharo14-Compatibility/CommandLineArguments.extension.st
new file mode 100644
index 0000000..cb8651b
--- /dev/null
+++ b/source/Launchpad-Pharo14-Compatibility/CommandLineArguments.extension.st
@@ -0,0 +1,17 @@
+Extension { #name : 'CommandLineArguments' }
+
+{ #category : '*Launchpad-Pharo14-Compatibility' }
+CommandLineArguments >> copySubcommand [
+	"Pharo 14 removed this message (Pharo 13 and older have it).  Answer the arguments without the first one."
+
+	^ self class withArguments: arguments allButFirst
+]
+
+{ #category : '*Launchpad-Pharo14-Compatibility' }
+CommandLineArguments >> optionAt: aString ifPresent: presentBlock ifAbsent: absentBlock [
+	"Pharo 14 removed this message (Pharo 13 and older have it)."
+
+	| option |
+	option := self optionAt: aString ifAbsent: [ ^ absentBlock value ].
+	^ presentBlock value: option
+]
diff --git a/source/Launchpad-Pharo14-Compatibility/CommandLineHandler.extension.st b/source/Launchpad-Pharo14-Compatibility/CommandLineHandler.extension.st
new file mode 100644
index 0000000..a15292b
--- /dev/null
+++ b/source/Launchpad-Pharo14-Compatibility/CommandLineHandler.extension.st
@@ -0,0 +1,14 @@
+Extension { #name : 'CommandLineHandler' }
+
+{ #category : '*Launchpad-Pharo14-Compatibility' }
+CommandLineHandler class >> prepareSubcommand: commandLineArguments [
+	"Pharo 14 removed this message (Pharo 13 and older have it)."
+
+	"strip the subcommand name from the arguments"
+	commandLineArguments withFirstArgument: [ :arg |
+		arg = self commandName
+			ifTrue: [ ^ commandLineArguments copySubcommand ] ].
+
+	"not a subcommand hence we keep the same args"
+	^ commandLineArguments
+]
diff --git a/source/Launchpad-Pharo14-Compatibility/package.st b/source/Launchpad-Pharo14-Compatibility/package.st
new file mode 100644
index 0000000..541c91a
--- /dev/null
+++ b/source/Launchpad-Pharo14-Compatibility/package.st
@@ -0,0 +1 @@
+Package { #name : 'Launchpad-Pharo14-Compatibility' }
Version locks: ba-st-launchpad.txt (download)
# Buoy replaces Symbol>>argumentCount of Pharo 14, and the load stops (docs/upstream/package-repairs.md).
Buoy ba-st-buoy

State of 2026-11-20. Made from the test records of the iospharo project (a second Pharo VM). The fixes are proposals for review.