From 77b2a21d9d550c35460d7d756b6d3f6ebc4ab146 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 7 Apr 2023 16:52:10 +0200 Subject: [PATCH 1/2] Execute release tests last We have a lot of tests in Pharo and it might happen that some of them do not respect the principle of letting the system clean with their tearDown. To help to spot those impacts, I propose to run the releases tests last. Like this, if some bad generated code/or modifications of system entities happens, we might catch it with the verifications of release tests. I expect this commit to break the tests in the CI but it'll help me find the culprits and fix them. --- .../TestCommandLineHandler.class.st | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/JenkinsTools-Core/TestCommandLineHandler.class.st b/src/JenkinsTools-Core/TestCommandLineHandler.class.st index c49bc80e04b..5fc76383266 100644 --- a/src/JenkinsTools-Core/TestCommandLineHandler.class.st +++ b/src/JenkinsTools-Core/TestCommandLineHandler.class.st @@ -97,12 +97,20 @@ TestCommandLineHandler >> informResults: results [ { #category : #accessing } TestCommandLineHandler >> packages [ - | packages | - packages := Set new. - self arguments - reject: [ :arg| arg beginsWith: '-'] - thenDo: [ :arg| self addPackagesMatching: arg to: packages ]. - ^ packages + + | packageNames releasePackageNames | + packageNames := Set new. + self arguments + reject: [ :arg | arg beginsWith: '-' ] + thenDo: [ :arg | self addPackagesMatching: arg to: packageNames ]. + + "Releases tests should be run last because the previous tests might miss some tear downs and let the system in a bad state. + Thus, if a release package is present in the list of packages, we move it last in the testing order." + releasePackageNames := packageNames select: [ :packageName | packageName beginsWith: 'Release' ]. + packageNames := packageNames asArray copyWithoutAll: releasePackageNames. + packageNames := packageNames copyWithAll: releasePackageNames. + + ^ packageNames ] { #category : #private } From e6a3014bbb4d2e8c4529caba5be59892d24860ef Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 7 Apr 2023 17:52:02 +0200 Subject: [PATCH 2/2] Fix bugs --- src/JenkinsTools-Core/TestCommandLineHandler.class.st | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/JenkinsTools-Core/TestCommandLineHandler.class.st b/src/JenkinsTools-Core/TestCommandLineHandler.class.st index 5fc76383266..45b6f68c4f2 100644 --- a/src/JenkinsTools-Core/TestCommandLineHandler.class.st +++ b/src/JenkinsTools-Core/TestCommandLineHandler.class.st @@ -106,8 +106,9 @@ TestCommandLineHandler >> packages [ "Releases tests should be run last because the previous tests might miss some tear downs and let the system in a bad state. Thus, if a release package is present in the list of packages, we move it last in the testing order." + packageNames := packageNames asArray. releasePackageNames := packageNames select: [ :packageName | packageName beginsWith: 'Release' ]. - packageNames := packageNames asArray copyWithoutAll: releasePackageNames. + packageNames := packageNames copyWithoutAll: releasePackageNames. packageNames := packageNames copyWithAll: releasePackageNames. ^ packageNames