Community-supported framework for testing Smalltalk projects on Linux, OS X, and Windows with built-in support for GitHub Actions, GitLab CI/CD, Travis CI, and AppVeyor.
It is inspired by builderCI and aims to provide a uniform and easy way to load and test Smalltalk projects.
.smalltalk.ston
,
setup-smalltalkCI
action,
.gitlab-ci.yml
,
.travis.yml
, and
appveyor.yml
.smalltalk.ston
file and specify how to load and test your project.You can use smalltalkCI to run your project's tests locally. Just clone or download smalltalkCI and then you can initiate a local build in headful mode like this:
bin/smalltalkci -s <IMAGE> --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.
On Windows, you need to run smalltalkCI from a Bash shell such as Git Bash or Cygwin, MinGW, or MSYS2.
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 | GToolkit |
---|---|---|---|---|
Squeak64-trunk |
Pharo64-alpha |
GemStone64-3.6.x |
Moose64-trunk |
GToolkit64-release |
Squeak64-6.0 |
Pharo64-stable |
GemStone64-3.5.8 |
Moose64-12 |
|
Squeak64-5.3 |
Pharo64-13 |
GemStone64-3.5.7 |
Moose64-11 |
|
Squeak64-5.2 |
Pharo64-12 |
GemStone64-3.5.6 |
Moose64-10 |
|
Squeak64-5.1 |
Pharo64-11 |
GemStone64-3.5.5 |
Moose64-9.0 |
|
Squeak32-trunk |
Pharo64-10 |
Gemstone64-3.5.4 |
Moose64-8.0 |
|
Squeak32-6.0 |
Pharo64-9.0 |
GemStone64-3.5.3 |
||
Squeak32-5.3 |
Pharo64-8.0 |
|||
Squeak32-5.2 |
Pharo64-7.0 |
|||
Squeak32-5.1 |
Pharo64-6.1 |
|||
Squeak32-5.0 |
Pharo64-6.0 |
|||
Squeak32-4.6 |
Pharo32-alpha |
|||
Squeak32-4.5 |
Pharo32-stable |
|||
Pharo32-12 |
||||
Pharo32-11 |
||||
Pharo32-10 |
||||
Pharo32-9.0 |
||||
Pharo32-8.0 |
||||
Pharo32-7.0 |
||||
Pharo32-6.1 |
||||
Pharo32-6.0 |
||||
Pharo32-5.0 |
||||
Pharo32-4.0 |
||||
Pharo32-3.0 |
.smalltalk.ston
TemplateThe 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 ]
}
]
}
For GitHub Action templates, please refer to the Marketplace listing of the
setup-smalltalkCI
action.
.gitlab-ci.yml
.travis.yml
.travis.yml
with multiple smalltalkCI configurations.travis.yml
with additional jobsappveyor.yml
appveyor.yml
with additional jobs.smalltalk.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 : 'src', // Path to source-code directory were are packages (i.e. 'packages' or 'src'), in case of packages are not on root
#failOn : [ #OCUndeclaredVariableWarning ], // Fail build on provided list of Warnings
#ignoreImage : true, // If true, Metacello will force a load of a package, overriding a previously existing one
#load : [ 'default' ], // Define MC load attributes
#onConflict : #useIncoming, // When there is a conflict between loaded sources and incoming sources (can be #useIncoming|#useLoaded)
#onUpgrade : #useIncoming, // When loaded sources are an older version than incoming sources (can be #useIncoming|#useLoaded)
#onWarningLog : true, // Log Warning messages to Transcript
#platforms : [ #squeak, #pharo, #gemstone ], // Define compatible platforms
#repository : 'http://smalltalkhub.com/mc/...', // Alternatively, define MC repository
#usernameEnvVar : 'GITHUB_USER', // Environment variable containing the username used for authentication
#passwordEnvVar : 'GITHUB_TOKEN', // Environment variable containing the password used for authentication
#useLatestMetacello : true, // Upgrade Metacello before loading
#version : '1.0.0' // Define MC version (for MC Configurations only)
#registerInIceberg : true // Pharo Only | Register the tested repository in Iceberg
}
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
#usernameEnvVar : 'USERNAME_VAR', // Environment variable containing the username used for authentication
#passwordEnvVar : 'PASSWORD_VAR', // Environment variable containing the password used for authentication
#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
#usernameEnvVar : 'USERNAME_VAR', // Environment variable containing the username used for authentication
#passwordEnvVar : 'PASSWORD_VAR', // Environment variable containing the password used for authentication
#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
#serializeError: false // (default: true) Disable serialization of failing test case (e.g. with Fuel in Pharo)
}
}
See COVERAGE.md.
It is possible to run custom scripts before and after the loading and
testing phases (preLoading
, postLoading
, preTesting
, postTesting
).
smalltalkCI can 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.
--print-env Print all environment variables used by smalltalkCI
--no-color Disable colored output
--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 "Squeak64-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 a supported
CI platform. This helps 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 the 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:
Feel free to send a PR to add your Smalltalk project to the
list. Please add [ci skip]
to your commit message.