summaryrefslogtreecommitdiff
path: root/morphlib/artifactresolver_tests.py
Commit message (Collapse)AuthorAgeFilesLines
* Use the modern way of the GPL copyright header: URL instead real addressJavier Jardón2015-03-161-3/+2
| | | | Change-Id: I992dc0c1d40f563ade56a833162d409b02be90a0
* Update artifact resolver and ckc testsRichard Ipsum2014-10-091-8/+8
| | | | | | The original resolve_artifacts method is essentially unchanged, it's just private now. This means that aside from this name change the tests remain the same.
* FIXUP: Fix unit tests after changing to per-source buildsRichard Maw2014-09-191-11/+13
|
* FIXUP: Fix up unit tests from change allowing multiple sourcesRichard Maw2014-09-191-210/+81
| | | | | This is logically part of the previous patch, but has been split out to ease reviewing.
* Remove Morphology.builds_artifactsRichard Maw2014-09-191-7/+0
| | | | | This was used before the Artifact splitting code landed to determine which artifacts should be produced.
* Don't validate morphologies during ArtifactResolverRichard Maw2014-09-171-28/+0
|
* unittests: Make the unittests use morphloaderAdam Coldrick2014-08-141-175/+147
| | | | | This commit removes all use of morph2 from the unittests, replacing it with morphloader/morph3. It also converts the test morphologies to YAML.
* Merge artifact splitting workRichard Maw2014-01-171-434/+155
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rationale ========= This patch series implements the concept of stratum splitting. For a long time we've had code to split a chunk into multiple artifacts, however there's not been a way to split strata up, or systems select a subset of the produced stratum artifacts to be included in the system. This patch series implements the ability to split strata and have systems include them in a way which still has the same behaviour if no rules are specified, but with default rules that split chunk artifacts up into various components, strata into runtime and development versions and has systems include everything by default, but can be told to include less. The default rules have chunk foo split up into -bins, -libs, -devel, -doc, -locale and -misc. These rules can be overridden in the chunk morphology by adding the new 'products' field, which lists match rules like the following: products: - artifact: libudev include: - (usr/)?lib(32|64)?/lubg?udev\..* - artifact: udev include: - (usr/)?s?bin/udev* - (usr/)?lib(32|64|exec)?/systemd/systemd-udevd Strata are by default split into -runtime and -devel. -devel by default contains chunks ending with -devel and -doc, -runtime contains everything else. Extra match rules can be added to a stratum similarly to chunks, but instead of matching file names, they match artifact names. products: - artifact: core-python include: - "cpython-.*" # lazy shortcut to put all of cpython in this stratum - "python-.*" # lazy shortcut to include all python chunks in Additionally, in chunk specs, chunk artifacts may be assigned to stratum artifacts, this takes precedence over products match rules in the stratum and the default match rules. Assigning the chunk to `null` will discard the chunk. chunks: ... - name: systemd ... artifacts: libudev: foundation-runtime udev: foundation-runtime systemd-doc: null By default a system includes every produced artifact of every stratum listed. Instead a subset can be specified in the stratum spec as follows: name: tiny-system strata: - name: build-essential ... artifacts: - build-essential-runtime
| * ArtifactResolver: Generate dependencies from split rulesRichard Maw2014-01-161-437/+155
|/ | | | | | | | | | | | | | | | | | One important change is that the builds_artifacts field of Morphologies is not used any more, since the split rules provide this information. Another important change is that the ArtifactResolver now only returns aritfacts that are required to build the root artifact, rather than every artifact in the build. Previously there was no distinction. This is required because when artifact splitting is in effect, some artifacts may be produced, but not depended on by anything. This confuses the BuildCommand, which expects to be able to find a single root artifact. NOTE: This change breaks artifact construction until "Split chunk morphologies according to new rules" and "Split Stratum artifacts according to new rules", since systems and strata depend on artifacts that weren't created.
* 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.
* Resolve tree SHA1 along with commit SHA1 when resolving refsJannis Pohlmann2012-09-051-43/+43
| | | | Adjust all other parts and the tests to work with this.
* ArtifactResolver: chunks cannot be duplicated in a stratumSam Thursfield2012-09-041-53/+53
| | | | | We now enforce name uniqueness and don't yet implement a way of providing an alias for chunks, so self-dependency is impossible.
* ArtifactResolverTests: use keyword args for FakeStratumMorphologySam Thursfield2012-08-301-34/+43
| | | | Helps avoid parameter-list-blindness when reading the testcases
* Strata should be referred to with full repo/ref/morph tripletsSam Thursfield2012-08-301-21/+42
| | | | | | | | This removes the requirement that all strata must be in the same repo as the system morphology. Both the system "strata" field and the stratum "build-depends" field are affected.
* Strata contain "chunks", not "sources"Sam Thursfield2012-08-291-8/+8
| | | | Rename "sources" field of stratum morphologies to "chunks".
* python scripts: pep8ize codebaseRichard Maw2012-08-011-210/+210
| | | | | | | | | 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.
* Have MorphologyFactory set Morphology.builds_artifactsLars Wirzenius2012-07-181-1/+13
| | | | | | | | | | | | | 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.
* tests: fix up for change in artifact nameRichard Maw2012-07-031-2/+26
| | | | | This fixes references to a system artifact without the -rootfs appended and adds a unit test for resolving an arm system artifact.
* Remove BuildGraph, compute cache keys based on Artifacts.Jannis Pohlmann2012-04-181-41/+1
| | | | | | | | | | | | With this commit, the ArtifactResolver no longer computes the cache keys when creating Artifact objects. This will have to happen as a post-resolving step (e.g. prior to building or checking whether a local or remote artifact cache has any of the resolved artifacts). The CacheKeyComputer now takes an Artifact object and computes the cache keys using its dependencies. BuildGraph is no longer needed for the CacheKeyComputer unit tests.
* Add a repo_name to Source, use that instead of repo in most places.Jannis Pohlmann2012-04-181-44/+42
| | | | | | | | | | This is because we will need to integrate a RemoteRepoCache and we don't always want to create a CachedRepo object (in fact, we only want that for the sources of artifacts we actually need to build). So we'll use either the local or the remote repo cache to resolve refs and morphology texts and then later, when actually caching a repo, we'll set the source.repo member to a CachedRepo object that we can then use to unpack the sources.
* Add original_name member to CachedRepo. Use it for SourcePool lookups.Jannis Pohlmann2012-04-171-42/+44
| | | | | | This is done to avoid a nasty mix of SourcePool lookups using CachedRepo objects (e.g. for strata within a system) versus lookups using repo names (e.g for sources within a stratum).
* Remove buggy cyclic dependency chain check from ArtifactResolver.Jannis Pohlmann2012-04-161-66/+1
| | | | However, leave a TODO note that we really want this in the source.
* Merge DependencyResolver into ArtifactResolver.Jannis Pohlmann2012-04-161-36/+484
|
* Add the new ArtifactResolver class.Jannis Pohlmann2012-04-121-0/+389
This class takes a CacheKeyComputer and a SourcePool, analyses the sources and their dependencies and creates a list of artifacts (represented by Artifact objects) that would be created when building sources in the pool.