Running checks as part of the development cycle

Even with CI/CD providing relatively quick feedback during development, for best-practice and the shortest development cycle we want to catch issues before committing back to the main branch, i.e. run a set of pre-commit checks.

This page provides some suggestions on how to run a subset of checks in your personal development environment as introduced in Remote Runner: checks, examples and tests.

RemoteRunner supports image and code synchronisation:

Image Synchronisation allows a worker process to start with an older image than the runner, and be sent a set of changes to apply to bring it up to the same state (code-wise) as the runner.

Code synchronisation keeps the worker's code base synchronised with the development image.

The following script starts a RemoteRunner with the following characteristics:

At least 4 workers are started. If system resources allow, i.e. there are enough cores and memory, additional workers will be started.

imageSync is enabled.

codeSync is enabled (this is the default for locally started workers).

Scheduling data is stored in the Gt userData directory.

schedulingTimes := FileLocator userData / 'Gt' / 'GtRrCheckSchedulingTimes.json'.
schedulingTimes parent ensureCreateDirectory.
GtRemoteRunner hasUniqueInstance ifTrue: [ GtRemoteRunner cleanUp ].
runner := GtRemoteRunner new.
runner managerStartupAndShutdown workerCountCalculator minWorkers: 4.
runner managerStartupAndShutdown imageSync: true.
runner start.
GtRemoteRunner setUniqueInstance: runner.
times := schedulingTimes exists
	ifTrue: [ GtRrCheckSchedulingTimes loadDefaultFromFile: schedulingTimes ]
	ifFalse: [ GtRrCheckSchedulingTimes default ].
runner.
  

We can then run a job with a subset of the checks available in the image. For example, if we are working on RemoteRunner the following subset is useful:

factory := GtRrChecksFactory new.
factory addExamplePackages: {
		'RemoteRunner' asPackage.
		'Lepiter-Store' asPackage.
		'GToolkit4Epicea' asPackage.
		'GToolkit-Utility-System' asPackage.
		'PharoLink' asPackage.
		}.
factory groupTasksByTime.
job := GtRemoteRunner default submitJob: factory job.
job showExamplesProgressNotification.
job.
  

We can then save the scheduling information for next time:

GtRrCheckSchedulingTimes default saveToFile: schedulingTimes.