summaryrefslogtreecommitdiff
path: root/morphlib/morphologyfactory_tests.py
Commit message (Collapse)AuthorAgeFilesLines
* Don't use repo or ref in test suiteRichard Maw2014-02-131-2/+0
|
* Replace chunk 'chunks' field with 'products'Richard Maw2014-01-151-5/+11
| | | | | | | | | | | | | | | | | | | I think that it's confusing for both strata and chunk morphologies to have a 'chunks' field, with the former listing sources and the latter listing rules for splitting this source into artifacts. The design for splitting strata has roughly the same idea, but operating on chunk artifact names, rather than file names, so a name that can be used for both was chosen. Splits and artifacts weren't satisfactory names, so they're now called 'products'. It was decided to break backwards compatibility of chunk morphologies being able to specify 'chunks', since the format has changed, so extra code would be required to translate the format, and the only users of the 'chunks' field was the test suite, since there was no way to select from the system, which chunk artifacts were included.
* Dropped support for 'system-kind' from system morphology filesDan Firth2013-09-271-8/+0
|
* morphologyfactory: validate stratum build-dependsRichard Maw2013-08-071-0/+43
| | | | | | | | | | | | A stratum morphology must either have stratum build-depends, or have some bootstrap chunks, otherwise there's no way to have the required set of commands to be able to build chunks. A concession has been made to also allow strata that contain chunks built in test mode, but this opens a reproducibility hole. Unit tests for these failures have been added, and the stratum used by other unit tests has been fixed.
* morphologyfactory: move empty stratum check hereRichard Maw2013-08-071-1/+18
| | | | | | | | | | | | | | | It is better to test whether a straum is empty here, since it will be noticed earlier in the build, as soon as the morphologies are loaded, rather than after they have all been parsed. It is also conceptually nicer to put it here, since the morphologyfactory was written to perform this kind of validation. On a more practical note, the validation is moved here so that the test for this error isn't masked by the test for no build dependencies. To ensure tests still pass, we alter the stratum morphology used by other unit tests to no longer be empty, and add an empty one to test.
* morphologyfactory: refactor chunk bdeps exceptionsRichard Maw2013-08-071-0/+17
| | | | | | | | | This creates a small exception hierarchy for failures to validate stratum morphologies. This is currently a line rather than a tree, but it will be expanded later in the patch series. This also adds test coverage for chunk build dependencies being omitted.
* Fix warnings and test suiteLars Wirzenius2013-06-201-3/+3
|
* Merge branch 'samthursfield/arch'Sam Thursfield2013-03-151-2/+13
|\ | | | | | | Reviewed-By: concensus
| * One 'arch' to rule them allSam Thursfield2013-03-151-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | Define a specific set of 4 architectures that Morph supports, and only expose that value to morphologies. Since GNU triplets are very common we also expose a GNU triplet. Other morphologies should work out their configuration based on MORPH_ARCH. This commit also removes the morphlib.util.arch() function, which detected the machine Morph is running on via 'uname -m'. Morph's architecture names do not necessarily map to the output of 'uname -m' so we should not rely on it anywhere.
* | Merge branch 'samthursfield/build-essential-2-rebase'Sam Thursfield2013-03-151-12/+0
|\ \ | |/ | | | | | | | | | | Conflicts: morphlib/bins_tests.py Reviewed-By: consensus
| * Add 'build-mode' field for chunks in a stratumSam Thursfield2013-03-131-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allowed values: staging: build with a staging chroot (default) test: build with the host's tools bootstrap: build with the host's tools, and do not include this chunk in the final stratum artifact In the past, 'normal mode' has been used to describe building a chunk with the host's tools. We don't want that mode to ever be used, because it is a huge hole in reproducability, but we need to keep it around to avoid making Morph's cmdtest suite depend on Baserock. Hopefully naming it 'test' should discourage potential abusers. It is unfortunate that the build tests now take a separate code path compared to real-world usage of Morph. However, this is necessary to avoid a circular dependency between Morph's test suite and the build-essential stratum in Baserock. We do whole-build testing of Baserock, too, so the 'staging' code path is still tested outside of Morph. However, testing a staging area requires populating it with at minimum a working shell, and this is a bit too complex to go in Morph's test suite.
* | Fix test caseLars Wirzenius2013-03-121-1/+7
|/
* Make rootfs-tarball build only the tarball also on ARMLars Wirzenius2013-02-201-7/+1
|
* Require morphology name to match filenameSam Thursfield2013-02-081-24/+32
| | | | | | | Allowing differences causes only confusion. Whether or not the 'name' field should surive at all is up for debate: it's very useful when seeing the contents of the morphology out of context (e.g. in documentation or pastebins), but is that worth the extra effort?
* Fix testsRichard Maw2013-01-221-4/+2
| | | | | | | | Invalid text changed to be something that doesn't parse as YAML either, and catch convert the YAMLError to the expected exception. Ideally there wouldn't be any `#pragma: no cover`s, but I could not trigger these code paths.
* Rename arm to armv7 and be consistentRichard Maw2012-09-201-1/+1
| | | | | armv5 and armv7 are different enough to be a problem, so specify which particular arm sub-architecture we currently support.
* Always ls-tree before trying to cat-fileSam Thursfield2012-08-241-1/+10
| | | | | This provides much better performance in cases where most of the repos do not have a .morph included.
* Use git ls-tree to autodetect build systemSam Thursfield2012-08-241-2/+12
| | | | | | | The cost of one git ls-tree call is roughly the same as one git cat-file call. Therefore, when autodetecting the build system, it is much faster to list the tree once and then search for the required files than to call git cat-file for every possible one.
* Merge branch 'master' of roadtrain.codethink.co.uk:baserock/morphLars Wirzenius2012-08-011-0/+8
|\ | | | | | | | | | | Conflicts: morphlib/morphologyfactory.py morphlib/morphologyfactory_tests.py
| * Raise clearer error on morphology parse errorsSam Thursfield2012-07-311-0/+7
| |
* | python scripts: pep8ize codebaseRichard Maw2012-08-011-12/+11
|/ | | | | | | | | This was done with the aid of the pep8 script, available by running `easy_install pep8`. It may be worth making this part of ./check, but that will require putting pep8 into the development tools stratum. This should be easy, given pep8 has no external dependencies.
* Require system-kind on system morphologiesLars Wirzenius2012-07-191-0/+9
|
* Set Morphology.needs_artifact_metadata_cachedLars Wirzenius2012-07-191-0/+12
|
* Have MorphologyFactor set Morphology.needs_staging_areaLars Wirzenius2012-07-191-1/+13
|
* Have MorphologyFactory set Morphology.builds_artifactsLars Wirzenius2012-07-181-1/+60
| | | | | | | | | | | | | This way we can have one place in the code where we determine what artifacts get built from a specific morphology, rather than spreading the information around the code base. From now on, everything is supposed to use the builds_artifacts attribute to get the list of artifacts. ArtifactResolver has been changed to do that. Some of the tests are now a bit messier, and should really be changed to create Morphology objects using MorphologyFactory, but that's a change for another day.
* Add missing empty lines, for clarityLars Wirzenius2012-07-181-0/+13
|
* morphologyfactory: infer build system without listRichard Maw2012-04-201-23/+39
| | | | | | | | | | Detecting the build system is managed by it asking if any files exist detecting if the file exists is done with a callback function. This callback can use cat-file. If list_files existed this could be more efficient as it would not require the files to be read from the remote server and it only needs to be one round-trip
* morphologyfactory: work without RemoteRepoCacheRichard Maw2012-04-201-3/+24
| | | | | There are cases where we would not need a remote cache, so it should be able to operate without one.
* add morphology factoryRichard Maw2012-04-191-0/+90