You will need roughly 2 minutes to read this article.
$DART_SDK is available in the Environment and included in the PATH. The installed version of the Dart SDK is
You can use these commands from the Dart SDK:
To change to another version, use this script in your Setup Commands.
You can install any dependencies you defined in your
pubspec.yaml by running
We do not cache Dart dependencies between builds by default, but any dependencies moved into the
$HOME/cache directory before the end of the build will be cached and can be retrieved from that directory on the next build.
As dart currently doesn’t have a default way to run your tests you can use exactly the same command to run those tests as you would on your local machine. Note that almost all tools that do not require root access for custom machine configuration will install and run without issue on Codeship.
We automatically have
xvfb running on our System. You can use Firefox, Chrome
or PhantomJS to run your Dart tests in a browser. You can read more in our
Browser Testing Guide
If you are running parallel test pipelines, you will want separate your tests into groups and call a group specifically in each pipeline. For instance:
pub run test tests/tests_1.dart
pub run test tests/tests_2.dart
In addition to parallelizing your tests explicitly via parallel pipelines, some customers have found using Dart test runner’s built-in test parallelization is a good way to speed up your tests.
Note that aggressive parallelization can cause resource and build failure issues, as well.
Due to Dart version and build issues, you may find it helpful to tests your commands with different versions via an SSH debug session if tests are running differently on Codeship compared to your local machine.
Do you think we need to improve this article? If so, please submit our feedback form to help us improve this article!