-
-
Notifications
You must be signed in to change notification settings - Fork 424
feat: automatic obtaining of tests packages via --project-name in command line #19584
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
Merged
guillep
merged 22 commits into
pharo-project:Pharo14
from
NathanMalenge:deleteTestPackages
Apr 28, 2026
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
1b894c5
created a function project name to get it with the flag
NathanMalenge a36e04a
now defineIsoTestStage has only two arguments and we get the testPack…
NathanMalenge d8ac772
Finalize --project-name support:
NathanMalenge 9a3f615
fix: resolve nested groups recursively in project baseline
NathanMalenge 1eb2dd8
test: update cli help test to include --project-name flag
NathanMalenge 8100205
As discussed with @jecisc, I let the hardcoded test packages for the …
NathanMalenge 4242e07
edit: for now we cannot launch all kernel and compiler tests so we gi…
NathanMalenge d968239
typo
NathanMalenge 0d59f39
test: add unit tests baseline resolution by packageName
NathanMalenge 36da2e9
edit: number of tests ran is now a global variable to improve maintai…
NathanMalenge 6b8529c
fix: --help command
NathanMalenge e1b9a01
Merge branch 'Pharo14' of github.com:pharo-project/pharo into deleteT…
NathanMalenge 4e413dc
created mock baselines for test
NathanMalenge 388e53a
add a test
NathanMalenge 3829402
re-build
NathanMalenge 930180d
fix: number of tests
NathanMalenge d83eaf3
Merge branch 'Pharo14' of github.com:pharo-project/pharo into deleteT…
NathanMalenge 4ea522c
Apply suggestions from code review
NathanMalenge 910f8b0
cleaning project tests implementation
NathanMalenge 069047b
Merge 4ea522cc7f8aa37076cd58a361f866166498e671
NathanMalenge 77d363c
Merge branch 'Pharo14' of github.com:pharo-project/pharo into deleteT…
NathanMalenge 5f9e10f
fix merge
NathanMalenge File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -143,11 +143,11 @@ Build Url: ${env.BUILD_URL} | |
|
|
||
|
|
||
|
|
||
| def defineIsoTestStage(stageName, projectName, testPackages){ | ||
| def defineIsoTestStage(stageName, projectName, testPackages=""){ | ||
| stage("Tests-ISO-" + stageName) { | ||
| def testGroup = "Tests" | ||
| timeout(2) { | ||
| dir(env.STAGE_NAME) { | ||
| dir(env.STAGE_NAME){ | ||
| def PHARO_MAJOR = shellOutput('git describe --tags --first-parent | cut -d\'-\' -f 1 | cut -c 2- | cut -d\'.\' -f 1-1') | ||
| def PHARO_MINOR = shellOutput('git describe --tags --first-parent | cut -d\'-\' -f 1 | cut -c 2- | cut -d\'.\' -f 2-2') | ||
| def PHARO_SHORT = PHARO_MAJOR + PHARO_MINOR | ||
|
|
@@ -157,7 +157,13 @@ def defineIsoTestStage(stageName, projectName, testPackages){ | |
| shell "bash -c './bootstrap/scripts/getPharoVM.sh ${PHARO_SHORT}'" | ||
| shell "bash -c './pharo metacello.image metacello install --save --strict --signalErrorOnWarning \"filetree://../src\" SUnit --groups Core'" | ||
| shell "bash -c './pharo metacello.image metacello install --save --strict --signalErrorOnWarning \"filetree://../src\" " + projectName + " --groups " + testGroup + "'" | ||
| shell "bash -c './pharo metacello.image test --junit-xml-output --stage-name ${env.STAGE_NAME} " + testPackages + " '" | ||
| /* | ||
| Some Baselines do specify tests in the Tests group that do not run on isolation. | ||
| For that scenario, users can define an explicit list of packages as `testPackages`. | ||
| In that case, take the packages specified by the user instead of the project packages. | ||
| */ | ||
| def testPackageArguments = testPackages == "" ? "--project-name ${projectName}" : testPackages | ||
| shell "bash -c './pharo metacello.image test --junit-xml-output --stage-name ${env.STAGE_NAME} ${testPackageArguments}'" | ||
| junit allowEmptyResults: false, testResults: "${env.STAGE_NAME}*.xml" | ||
| } | ||
| } | ||
|
|
@@ -183,17 +189,17 @@ def bootstrapImage(){ | |
| } | ||
|
|
||
| def isoTesters = [:] | ||
| isoTesters['SUnit'] = { defineIsoTestStage("SUnit", "SUnit", "\'SUnit-Tests\' \'SUnit-Visitor-Tests\' \'SUnit-MockObjects-Tests\'") } | ||
| isoTesters['SUnit'] = { defineIsoTestStage("SUnit", "SUnit") } | ||
| isoTesters['Kernel'] = { defineIsoTestStage("Kernel", "Kernel", "\'Kernel-Tests\' \'Kernel-CodeModel-Tests\'") } | ||
| isoTesters['Compiler'] = { defineIsoTestStage("Compiler", "Compiler", "\'OpalCompiler-Tests\' \'DebugInfo-Tests\' \'Kernel-Extended-Tests\' \'Kernel-Tests-WithCompiler\'") } | ||
| isoTesters['Files'] = { defineIsoTestStage("Files", "Files", "\'Files-Tests\'") } | ||
| isoTesters['Zinc-Character-Encoding'] = { defineIsoTestStage("Zinc-Character-Encoding", "ZincCharacterEncoding", "\'Zinc-Character-Encoding-Tests\'") } | ||
| isoTesters['System-SessionManager'] = { defineIsoTestStage("System-SessionManager", "SystemSessionManager", "\'System-SessionManager-Tests\'") } | ||
| isoTesters['System-Platforms'] = { defineIsoTestStage("System-Platforms", "SystemPlatforms", "\'System-Platforms-Tests\'") } | ||
| isoTesters['Announcements-Core'] = { defineIsoTestStage("Announcements-Core", "Announcements", "\'Announcements-Core-Tests\'") } | ||
| isoTesters['Shift-ClassBuilder'] = { defineIsoTestStage("Shift-ClassBuilder", "Shift", "\'Shift-ClassBuilder-Tests\'") } | ||
| isoTesters['System-CommandLineHandler'] = { defineIsoTestStage("System-CommandLineHandler", "SystemCommandLineHandler", "\'System-CommandLineHandler-Tests\'") } | ||
| isoTesters['FileSystem'] = { defineIsoTestStage("FileSystem", "FileSystem", "\'FileSystem-Core-Tests\' \'FileSystem-Disk-Tests\' \'FileSystem-Tests-Attributes\'") } | ||
| isoTesters['Files'] = { defineIsoTestStage("Files", "Files") } | ||
| isoTesters['Zinc-Character-Encoding'] = { defineIsoTestStage("Zinc-Character-Encoding", "ZincCharacterEncoding") } | ||
| isoTesters['System-SessionManager'] = { defineIsoTestStage("System-SessionManager", "SystemSessionManager") } | ||
| isoTesters['System-Platforms'] = { defineIsoTestStage("System-Platforms", "SystemPlatforms") } | ||
| isoTesters['Announcements-Core'] = { defineIsoTestStage("Announcements-Core", "Announcements") } | ||
| isoTesters['Shift-ClassBuilder'] = { defineIsoTestStage("Shift-ClassBuilder", "Shift") } | ||
|
Comment on lines
+195
to
+200
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not unify the first two args? |
||
| isoTesters['System-CommandLineHandler'] = { defineIsoTestStage("System-CommandLineHandler", "SystemCommandLineHandler") } | ||
| isoTesters['FileSystem'] = { defineIsoTestStage("FileSystem", "FileSystem") } | ||
| parallel isoTesters | ||
|
|
||
| stage ("Full Image") { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/SUnit-UI-Tests/BaselineOfClapMockGeneralProject.class.st
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| Class { | ||
| #name : 'BaselineOfClapMockGeneralProject', | ||
| #superclass : 'BaselineOf', | ||
| #category : 'SUnit-UI-Tests-Mocks', | ||
| #package : 'SUnit-UI-Tests', | ||
| #tag : 'Mocks' | ||
| } | ||
|
|
||
| { #category : 'baselines' } | ||
| BaselineOfClapMockGeneralProject >> baseline: spec [ | ||
| <baseline> | ||
| spec for: #common do: [ | ||
| spec package: 'FakePackage1'. | ||
| spec package: 'FakePackage2'. | ||
| spec package: 'FakePackage-Tests' with: [ spec requires: #('FakePackage1') ]. | ||
|
|
||
| spec group: 'Core' with: #('FakePackage2'). | ||
| spec group: 'aGroup' with: #('FakePackage1' 'Core'). | ||
| spec group: 'Tests' with: #('FakePackage-Tests' 'aGroup') | ||
| ] | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| Class { | ||
| #name : 'BaselineOfClapMockNoTestGroup', | ||
| #superclass : 'BaselineOf', | ||
| #category : 'SUnit-UI-Tests-Mocks', | ||
| #package : 'SUnit-UI-Tests', | ||
| #tag : 'Mocks' | ||
| } | ||
|
|
||
| { #category : 'baselines' } | ||
| BaselineOfClapMockNoTestGroup >> baseline: spec [ | ||
| <baseline> | ||
| spec for: #common do: [ | ||
| spec package: 'FakePackage1'. | ||
| spec package: 'FakePackage2'. | ||
| spec package: 'FakePackage-Tests' with: [ spec requires: #('FakePackage1') ]. | ||
|
|
||
| spec group: 'Core' with: #('FakePackage2'). | ||
| ] | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.