Running Unit Tests
Elliot Jordan edited this page Nov 29, 2020
·
2 revisions
Unit testing helps us ensure that newly added features and major changes to the AutoPkg codebase do not introduce errors or unwanted behavior.
If you're contributing relatively minor changes to AutoPkg, you probably do not need to run unit tests. The steps below are for major contributions and/or future use in continuous integration pipelines.
-
Install AutoPkg's (with embedded Python 3) and
git
if you haven't already. -
Clone the AutoPkg repo to your local computer.
git clone https://github.com/autopkg/autopkg.git
-
Change to the Scripts subdirectory within the repo.
cd autopkg/Scripts
-
Run the test script.
/usr/local/autopkg/python run_tests.py
You should see output that displays the result of each test:
test_get_identifier_from_recipe_file_returns_identifier (tests.test_autopkglib.TestAutoPkg) get_identifier_from_recipe-file should return identifier. ... ok test_get_identifier_from_recipe_file_returns_none (tests.test_autopkglib.TestAutoPkg) get_identifier_from_recipe-file should return None if no identifier. ... ok ...etc...
- Introduction
- Getting Started
- Overview of Using AutoPkg
- FAQ
- More Resources
- Removing AutoPkg
-
AutoPkg Reference
- Preferences
- Recipes
- Processors
-
Processor Reference
- AppDmgVersioner
- AppPkgCreator
- BrewCaskInfoProvider
- CodeSignatureVerifier
- Copier
- CURLDownloader
- CURLTextSearcher
- DeprecationWarning
- DmgCreator
- DmgMounter
- EndOfCheckPhase
- FileCreator
- FileFinder
- FileMover
- FlatPkgPacker
- FlatPkgUnpacker
- GitHubReleasesInfoProvider
- Installer
- InstallFromDMG
- MunkiCatalogBuilder
- MunkiImporter
- MunkiInfoCreator
- MunkiInstallsItemsCreator
- MunkiOptionalReceiptEditor
- MunkiPkginfoMerger
- MunkiSetDefaultCatalog
- PackageRequired
- PathDeleter
- PkgCopier
- PkgCreator
- PkgExtractor
- PkgInfoCreator
- PkgPayloadUnpacker
- PkgRootCreator
- PlistEditor
- PlistReader
- SparkleUpdateInfoProvider
- StopProcessingIf
- Symlinker
- Unarchiver
- URLDownloader
- URLDownloaderPython
- URLGetter
- URLTextSearcher
- Versioner
- Development