Community-supported framework for testing Smalltalk projects on Linux, OS X, and Windows with built-in support for Travis CI, AppVeyor, and GitLab CI/CD.
It is inspired by builderCI and aims to provide a uniform and easy way to load and test Smalltalk projects.
- Features
- How to enable Travis CI for your Smalltalk project
- How to test your Smalltalk project locally
- List Of Supported Images
- Templates
- Further Configuration
- Contributing
- Projects using smalltalkCI
- Simple configuration via
.smalltalk.ston
,.travis.yml
,appveyor.yml
, and.gitlab-ci.yml
- Compatible across different Smalltalk dialects (Squeak, Pharo, GemStone)
- Runs on Travis CI's container-based infrastructure ("Builds start in seconds")
- Supports Linux, macOS, and Windows and can be run locally (e.g. for debug purposes)
- Exports test results in the JUnit XML format as part of the Travis build log
- Supports coverage testing and publishes results to coveralls.io
- Export your project in a compatible format (e.g. FileTree).
- Enable Travis CI for your repository.
- Create a
.travis.yml
and specifiy the Smalltalk image(s) you want your project to be tested against. - Create a
.smalltalk.ston
(see below for templates) and specify how to load and test your project. - Push all of this to GitHub and enjoy your fast Smalltalk builds!
You can use smalltalkCI to run your project's tests locally. Just clone or download smalltalkCI and then you are able to initiate a local build in headful mode like this:
bin/smalltalkci --headful /path/to/your/project/.smalltalk.ston
IMAGE
can be one of the supported images. You may also want to
have a look at all supported options.
Please note: All builds will be stored in _builds
within smalltalkCI's
directory. You may want to delete single or all builds if you don't need them as
they can take up a lot of space on your drive.
Squeak | Pharo | GemStone | Moose |
---|---|---|---|
Squeak-trunk |
Pharo(64)-alpha |
GemStone-3.3.x |
Moose-trunk |
Squeak-5.1 |
Pharo(64)-stable |
GemStone-3.2.x |
Moose-6.1 |
Squeak-5.0 |
Pharo(64)-7.0 |
GemStone-3.1.0.x |
Moose-6.0 |
Squeak-4.6 |
Pharo(64)-6.1 |
Gemstone-2.4.x |
|
Squeak-4.5 |
Pharo(64)-6.0 |
||
Pharo-5.0 |
|||
Pharo-4.0 |
|||
Pharo-3.0 |
The following SmalltalkCISpec
will load BaselineOfMyProject
using
Metacello/FileTree from the ./packages
directory in Squeak, Pharo, and
GemStone. See below how you can
customize your SmalltalkCISpec
.
SmalltalkCISpec {
#loading : [
SCIMetacelloLoadSpec {
#baseline : 'MyProject',
#platforms : [ #squeak, #pharo, #gemstone ]
}
]
}
language: smalltalk
sudo: false
# Select operating system(s)
os:
- linux
- osx
# Select compatible Smalltalk image(s)
smalltalk:
- Squeak-trunk
- Squeak-5.1
- Squeak-5.0
- Squeak-4.6
- Squeak-4.5
- Pharo-alpha
- Pharo-stable
- Pharo-7.0
- Pharo-6.1
- Pharo-6.0
- Pharo-5.0
- Pharo-4.0
- Pharo-3.0
- Pharo64-alpha
- Pharo64-stable
- Pharo64-7.0
- Pharo64-6.1
- Pharo64-6.0
- GemStone-3.3.0
- GemStone-3.2.12
- GemStone-3.1.0.6
# Override `script` to customize smalltalkCI invocation, e.g.:
#script:
# - smalltalkci .mysmalltalk1.ston
# - travis_wait smalltalkci .mysmalltalk2.ston
# Uncomment to enable caching (only useful for GemStone builds (3x faster))
#cache:
# directories:
# - $SMALLTALK_CI_CACHE
environment:
CYG_ROOT: C:\cygwin
CYG_BASH: C:\cygwin\bin\bash
CYG_CACHE: C:\cygwin\var\cache\setup
CYG_EXE: C:\cygwin\setup-x86.exe
CYG_MIRROR: http://cygwin.mirror.constant.com
SCI_RUN: /cygdrive/c/smalltalkCI-master/bin/smalltalkci
matrix:
# Currently, only Squeak and Pharo images are supported on AppVeyor.
- SMALLTALK: Squeak-trunk
- SMALLTALK: Squeak-5.0
- SMALLTALK: Pharo-6.0
- SMALLTALK: Pharo-5.0
# ...
platform:
- x86
install:
- '%CYG_EXE% -dgnqNO -R "%CYG_ROOT%" -s "%CYG_MIRROR%" -l "%CYG_CACHE%" -P unzip'
- ps: Start-FileDownload "https://github.com/hpi-swa/smalltalkCI/archive/master.zip" "C:\smalltalkCI.zip"
- 7z x C:\smalltalkCI.zip -oC:\ -y > NULL
build: false
test_script:
- '%CYG_BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; $SCI_RUN"'
image: hpiswa/smalltalkci
SqueakTrunk:
script: smalltalkci -s "Squeak-trunk"
Squeak5.1:
script: smalltalkci -s "Squeak-5.1"
PharoAlpha:
script: smalltalkci -s "Pharo-alpha"
Pharo7.0:
script: smalltalkci -s "Pharo-7.0"
# ...
`.travis.yml` template with multiple smalltalkCI configurations
The build matrix can be expanded with multiple smalltalkCI configuration files
using the smalltalk_config
key:
language: smalltalk
sudo: false
smalltalk:
- Squeak-trunk
- Pharo-alpha
smalltalk_config:
- .smalltalk.ston
- .bleedingEdge.ston
The .bleedingEdge.ston
configuration may look like this:
SmalltalkCISpec {
#loading : [
SCIMetacelloLoadSpec {
...
#load : [ 'CoreWithExtras' ],
#version : #bleedingEdge
}
],
...
}
Smalltalk | Config | OS |
---|---|---|
Squeak-trunk |
.smalltalk.ston |
Linux |
Squeak-trunk |
.bleedingEdge.ston |
Linux |
Pharo-alpha |
.smalltalk.ston |
Linux |
Pharo-alpha |
.bleedingEdge.ston |
Linux |
`.travis.yml` template with additional jobs
It is possible to add additional jobs to the build matrix
using the smalltalk_config
key:
language: smalltalk
sudo: false
os: osx
smalltalk:
- Squeak-5.1
- Pharo-6.0
matrix:
include:
- smalltalk: Squeak-trunk
smalltalk_config: .bleedingEdge.ston
- smalltalk: Pharo-alpha
smalltalk_config: .bleedingEdge.ston
allow_failures: # Allow bleeding edge builds to fail
- smalltalk_config: .bleedingEdge.ston
Smalltalk | Config | OS |
---|---|---|
Squeak-5.1 |
.smalltalk.ston |
macOS |
Pharo-6.0 |
.smalltalk.ston |
macOS |
Squeak-trunk |
.bleedingEdge.ston |
macOS |
Pharo-alpha |
.bleedingEdge.ston |
macOS |
`appveyor.yml` template with additional jobs
It is possible to add additional jobs to the
build matrix using environment.matrix
as follows:
environment:
CYG_ROOT: C:\cygwin
CYG_BASH: C:\cygwin\bin\bash
CYG_CACHE: C:\cygwin\var\cache\setup
CYG_EXE: C:\cygwin\setup-x86.exe
CYG_MIRROR: http://cygwin.mirror.constant.com
SCI_RUN: /cygdrive/c/SMALLTALKCI-master/bin/smalltalkci
matrix:
- SMALLTALK: Squeak-5.1
- SMALLTALK: Squeak-trunk
SMALLTALK_CONFIG: .bleedingEdge.ston
- SMALLTALK: Pharo-6.0
- SMALLTALK: Pharo-alpha
SMALLTALK_CONFIG: .bleedingEdge.ston
platform:
- x86
install:
- '%CYG_EXE% -dgnqNO -R "%CYG_ROOT%" -s "%CYG_MIRROR%" -l "%CYG_CACHE%" -P unzip'
- ps: Start-FileDownload "https://github.com/hpi-swa/SMALLTALKCI/archive/master.zip" "C:\SMALLTALKCI.zip"
- 7z x C:\SMALLTALKCI.zip -oC:\ -y > NULL
build: false
test_script:
- '%CYG_BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; $SCI_RUN $SMALLTALK_CONFIG"'
Smalltalk | Config |
---|---|
Squeak-5.1 |
.smalltalk.ston |
Squeak-trunk |
.bleedingEdge.ston |
Pharo-6.0 |
.smalltalk.ston |
Pharo-alpha |
.bleedingEdge.ston |
smalltalkCI requires a .smalltalk.ston
configuration file which can be
customized for a project to cover various use cases.
The .smalltalk.ston
must be a valid STON file and has to contain a
single SmalltalkCISpec
object.
This object can hold one or more load specifications in
#loading
and configurations for the TestCase selection
in #testing
.
SmalltalkCISpec {
#name : 'My Name', // Name of the SmalltalkCISpec (optional)
#loading : [
// List Of Load Specifications...
],
#testing : {
// TestCase Selection...
}
}
smalltalkCI supports different formats for loading Smalltalk projects and for
each, there is a loading specification.
One or more of those loading specifications have to be provided in the
#loading
list as part of a SmalltalkCISpec
.
smalltalkCI will load all specifications that are compatible with the selected
Smalltalk image (specified via #platforms
).
A SCIMetacelloLoadSpec
loads a project either via the specified Metacello
#baseline
or the Metacello
#configuration
. If a #directory
is specified,
the project will be loaded using FileTree/Metacello
from the given directory.
Otherwise, it will be loaded from the specified #repository
.
SCIMetacelloLoadSpec {
#baseline : 'MyProject', // Define MC Baseline
#configuration : 'MyProject', // Alternatively, define MC Configuration
#directory : 'packages', // Path to packages if FileTree is used
#repository : 'http://smalltalkhub.com/mc/...', // Alternatively, define MC repository
#onWarningLog : true, // Log Warning messages to Transcript
#failOn : [ #OCUndeclaredVariableWarning ], // Fail build on provided list of Warnings
#useLatestMetacello : true, // Upgrade Metacello before loading
#load : [ 'default' ], // Define MC load attributes
#platforms : [ #squeak, #pharo, #gemstone ], // Define compatible platforms
#version : '1.0.0' // Define MC version (for MC
// Configurations only)
}
A SCIMonticelloLoadSpec
loads a project with Monticello. It is
possible to load the latest version of packages from a remote repository
(#packages
) or specific versions (#versions
).
SCIMonticelloLoadSpec {
#url : 'http://ss3.gemtalksystems.com/ss/...', // Define URL for repository
#packages : ['MyProject-Core', 'MyProject-Tests'], // Load packages and/or
#versions : ['MyProject-Core-aa.12'], // Load specific versions
#platforms : [ #squeak, #pharo, #gemstone ] // Define compatible platforms
}
A SCIGoferLoadSpec
works similar to a SCIMonticelloLoadSpec
, but uses
Gofer on top of Monticello to load a project.
SCIGoferLoadSpec {
#url : 'http://smalltalkhub.com/mc/...', // Define URL for repository
#packages : ['MyProject-Core', 'MyProject-Tests'], // Load packages and/or
#versions : ['MyProject-Core-aa.12'], // Load specific versions
#platforms : [ #squeak, #pharo, #gemstone ] // Define compatible platforms
}
smalltalkCI runs a list of TestCases during a build.
By default, smalltalkCI will use a list of all TestCases that it has loaded into
the image.
It is possible to adjust this list using the #testing
slot.
In general, TestCases can be selected on class-level (#classes
), on
category-level (#categories
), on package-level (#packages
) and on
project-level (#projects
, GemStone only).
#classes
expects a list of class name symbols, #categories
and #packages
expect category names and prefixes or package names and prefixes respectively.
The default list can be replaced by a list of all TestCases that are present in
the image by setting #allTestCases
to true
.
Additionally, it is possible to add (#include
) or remove (#exclude
) classes
from this list.
The list can also be specified explicitly which means that only these
TestCases will run.
SmalltalkCISpec {
...
#testing : {
// Include specific TestCases
#include : {
#classes : [ #AnotherProjectTestCase ],
#categories : [ 'AnotherProject-Tests' ],
#packages : [ 'AnotherProject.*' ],
#projects : [ 'BaselineOfMyProject' ]
},
// Exclude specific TestCases from testing
#exclude : {
#classes : [ #AnotherProjectTestCase ],
#categories : [ 'AnotherProject-Tests' ],
#packages : [ 'AnotherProject.*' ],
#projects : [ 'ConfigurationOfMyOtherProject' ]
},
#allTestCases : true, // Run all TestCases in image
// Define TestCases explicitly
#classes : [ #MyProjectTestCase ],
#categories : [ 'MyProject-*' ],
#packages : [ 'MyProject.*' ],
#projects : [ 'BaselineOfMyProject' ],
// Other options
#defaultTimeout : 30, // In seconds (Squeak, and Pharo 6 or later)
#failOnSCIDeprecationWarnings : false, // Fail if a deprecated smalltalkCI API is used
#failOnZeroTests : false, // Pass builds that did not run any tests
#hidePassingTests : true // Hide passing tests when printing to stdout
}
}
smalltalkCI supports coverage testing and sends coverage results automatically
to coveralls.io when the feature is enabled and when running on
Travis CI or AppVeyor.
Make sure you have coveralls enabled for your GitHub repository.
In order to enable coverage testing in smalltalkCI, the #testing
slot needs to
contain a #coverage
dictionary.
This dictionary can contain #packages
(recommended), #classes
, or
#categories
.
smalltalkCI immitates the TestRunner
's behavior when using #packages
.
On the other hand, #classes
will be resolved to all methods of all classes
specified (instance side), while #categories
will be resolved
to all classes' methods as well as their meta classes' methods.
SmalltalkCISpec {
...
#testing : {
...
#coverage : {
#packages : [ 'Packages-To-Cover.*' ],
#classes : [ #ClassToCover, #'ClassToCover class' ],
#categories : [ 'Categories-To-Cover*' ]
}
}
}
It is possible to run custom scripts before and after the loading and
testing phases (preLoading
, postLoading
, preTesting
, postTesting
).
smalltalkCI is able to file in single files, lists of files, and
SCICustomScript
s which can be used to only run certain scripts on certain
platforms.
SmalltalkCISpec {
#preLoading : 'scripts/preLoading.st',
#loading : ...,
#postLoading : [
'scripts/postLoading1.st',
'scripts/postLoading2.st'
],
#preTesting : SCICustomScript {
#path : 'scripts/preTesting.st',
#platforms : [ #squeak, #pharo, #gemstone ]
},
#testing : ...,
#postTesting : [
SCICustomScript {
#path : 'scripts/postTestingSqueak.st',
#platforms : [ #squeak ]
},
SCICustomScript {
#path : 'scripts/postTestingPharo.st',
#platforms : [ #pharo ]
}
]
}
smalltalkCI has a couple of command line options that can be useful for debugging purposes or when used locally:
USAGE: bin/smalltalkci [options] /path/to/project/your_smalltalk.ston
This program prepares Smalltalk images/vms, loads projects and runs tests.
OPTIONS:
--clean Clear cache and delete builds.
-d | --debug Enable debug mode.
-h | --help Show this help text.
--headful Open vm in headful mode and do not close image.
--image Custom image for build (Squeak/Pharo).
--install Install symlink to this smalltalkCI instance.
--no-tracking Disable collection of anonymous build metrics (Travis CI & AppVeyor only).
-s | --smalltalk Overwrite Smalltalk image selection.
--uninstall Remove symlink to any smalltalkCI instance.
-v | --verbose Enable 'set -x'.
--vm Custom VM for build (Squeak/Pharo).
EXAMPLE:
bin/smalltalkci -s "Squeak-trunk" --headful /path/to/project/.smalltalk.ston
smalltalkCI collects anonymous build metrics (Smalltalk dialect, CI environment,
build status, build duration) for public repositories when running on Travis CI
or AppVeyor.
This allows to identify build errors caused by smalltalkCI updates and
therefore helps to improve the service. It is possible to opt-out by using the
--no-tracking
option.
Jobs on Travis CI timeout if they don't produce output for
more than 10 minutes. In case of long running tests, it
is possible to increase this timeout by setting $SMALLTALK_CI_TIMEOUT
in your
.travis.yml
to a value greater than 10:
env:
- SMALLTALK_CI_TIMEOUT=30
The above sets the timeout to 30 minutes. Please note that Travis CI enforces a total build timeout of 50 minutes.
By default, the smalltalkCI master branch is used to perform a build. It is
possible to select a different smalltalkCI branch or fork for testing/debugging
purposes by adding the following to the .travis.yml
:
smalltalk_edge:
source: hpi-swa/smalltalkCI
branch: dev
Please feel free to open issues or to send pull requests if you'd like to discuss an idea or a problem.
In alphabetical order:
- @ba-st: Buoy, RenoirSt, Willow.
- @Cormas: Cormas.
- @dalehenrich: obex, tode.
- @DuneSt: Heimdall, MaterialDesignLite, PrismCodeDisplayer.
- @dynacase: borm-editor, borm-model, borm-persistence, class-editor, demo-editor, dynacase, dynacase-model, fsm-editor.
- @HPI-BP2015H: squeak-parable.
- @HPI-SWA-Teaching: Algernon-Launcher.
- @hpi-swa: animations, Ohm-S, vivide.
- @marianopeck: OSSubprocess, FFICHeaderExtractor.
- @newapplesho: aws-sdk-smalltalk, elasticsearch-smalltalk, mixpanel-smalltalk, OpenExchangeRates, pardot-smalltalk, salesforce-smalltalk, sendgrid-smalltalk, twilio-smalltalk.
- @ObjectProfile: Roassal2.
- @pharo-project: pharo-project-proposals.
- @PolyMathOrg: PolyMath.
- @SeasideSt: Grease, Parasol, Seaside.
- @SergeStinckwich: PlayerST.
- @theseion: Fuel.
- @Uko: GitHubcello, QualityAssistant, Renraku.
- @UMMISCO: Kendrick.
- @zecke: osmo-smsc.
- More Projects...
Feel free to send a PR to add your Smalltalk project to the
list. Please add [ci skip]
to your commit message.