path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* upgrade: improve self upgrade functionality a bitTimo Teräs2016-07-229-1/+121
| | | | trigger it only if apk-tools can be upgrade, add test cases
* sort world dependencies alphabeticallyTimo Teräs2015-01-304-14/+14
| | | | | | | this makes 'lbu diff' and aaudit diffs nice when a world dependency is added or removed. sorting also makes the ordering more deterministic as the world targets constraints are always applied in the same order. test suite updated accordingly.
* solver: enforce conflicts during upgrades and new pkg installsTimo Teräs2014-10-063-0/+50
| | | | | | | This makes sure any conflicted packages will be removed first. Useful if we know there are conflicting files, and want to avoid adding potentially harmful replaces line. Add a test case for this too.
* solver: fix installation of non-repository packages during tmpfs bootTimo Teräs2014-05-191-0/+8
| | | | | allow packages in the cache's installed to be selected for installation by the solver. add test case for the issue.
* test: improve loading of repositories, fix broken install-if testTimo Teräs2014-05-191-0/+8
* del: allow deletion of world dependency when it is not installedTimo Teräs2014-05-191-0/+7
| | | | | this happens e.g. after tmpfs boot when not all packages where available: the dependency is in world, but not installed.
* solver: if pinning is specified, it overrides preferred reposTimo Teräs2013-09-063-0/+19
| | | | add also a test case for this
* commit, db: make file conflicts and script errors non-fatalTimo Teräs2013-06-203-4/+4
| | | | fixes #1482
* solver: properly order deletion of unneeded packagesTimo Teräs2013-06-194-2/+49
* upgrade: new option: --latest (-l)Timo Teräs2013-06-193-3/+28
| | | | | | | | | | | | | Select latest version of package (if it is not pinned), and print error if it cannot be installed due to other dependencies. Together with --available, it selects the latest package which is present at least in some repository. This also fixes few solver issues with ordering of package selection that got quite apparent with this flag. Namely, we cannot "lock" a package until it's reverse dependencies are locked or not all of the solver flags are propagated properly.
* errors: fix a test case, and misanalysis of certain namesTimo Teräs2013-06-181-1/+1
| | | | | | the pinning11 changed when @repo got the leading @ on error messages. analyze_dep() now properly ignores conflict dependencies, as those names are usually intentionally left unassigned.
* errors: improve analysis for virtual packagesTimo Teräs2013-06-182-1/+7
| | | | | if all packages named N provide the virtual package, list only the name N instead of all packages providing it.
* errors: detect self-conflicts properlyTimo Teräs2013-06-142-2/+7
| | | | | and add the provided version information to the conflicts. fixes the final test case that was broken. hooray.
* solver, errors: fix few additional test cases and clean upsTimo Teräs2013-06-133-3/+5
* errors: rewrite the logic how errors are reportedTimo Teräs2013-06-1312-20/+74
| | | | | | | Instead of the dependency oriented logic, switch to print them for each package or name needed. Might give a bit more readable errors now. There's still few corner cases that proper error is not output, which are cought by the test cases.
* solver: prune broken world dependencies with --forceTimo Teräs2013-06-133-0/+23
| | | | mostly useful for reboot, when all packages are not available.
* solver: rewrite as deductive solver -- pinning supportTimo Teräs2013-06-1316-24/+70
| | | | Fix also pinning test cases to be more sane.
* solver: rewrite as deductive solver -- per name flagsTimo Teräs2013-06-136-0/+55
| | | | | Handle properly per-name preference flags, and add test cases for testing those via fix applet.
* solver: rewrite as deductive solver -- core featuresTimo Teräs2013-06-138-8/+8
| | | | | Implementing basic dependency handling, install_if and awareness of pinning.
* db: unify handling of special packagesTimo Teräs2013-05-302-0/+14
| | | | | | make cache a special kind of repository, and automatically cache special packages (virtual packages, or ones installed from command line). add test cases for handling virtual packages. fixes #1617.
* test: fix conflict2 expectation after solver changesTimo Teräs2012-10-091-1/+1
| | | | | The 'a' package is now more preferred which actually makes more sense.
* solver, test: make conflicts unconditionalTimo Teräs2012-02-291-1/+1
| | | | | | | Solver will now never report partial solution where a conflict constraint is not satisfied. The is because with --force we might install the partial solution; and if conflicted packages were to be installed we might have extra trouble.
* solver: consider provided names also for preferenceTimo Teräs2012-02-281-0/+6
| | | | ref #574
* solver: allow multiple packages with same virtual providesTimo Teräs2012-02-282-5/+5
| | | | ref #574
* solver, test: implements more provides things, add testsTimo Teräs2012-02-275-0/+71
| | | | ref #574
* solver: unallowed pinning is worse than changing installed packageTimo Teräs2012-02-241-0/+10
* test: clean up solver.shTimo Teräs2012-02-241-5/+9
| | | | | * take list of tests to run (and default to all) * merge the awk invocation to a function
* solver: non preferred actions are worse then non preferred pinningTimo Teräs2012-02-243-0/+39
| | | | | | | | Otherwise we might start to change packages unexpectedly when not upgrading. This also fixes some other things the solver might've decided to do. Add also few test cases to detect bad behaviour.
* pkg, db: use 's' for source repository tags instead of 'p'Timo Teräs2012-02-241-2/+2
| | | | Will use 'p' for provides.
* test: improve pinning testsTimo Teräs2012-02-249-4/+77
* test: rewrite the testing framework to use the real appletsTimo Teräs2012-02-2352-115/+208
| | | | also merge the expected output to the *.test files.
* solver: fix regression from "calculate branch minimum penalty early"Timo Teräs2012-01-201-2/+1
| | | | | | | Forgot to reset per-name penalty when it got locked by apply_decision. This also fine tunes compare_package_preference() to always prefer packages specified on command line speeding up calculation certain complicated solutions.
* solver: calculate branch minimum penalty earlyTimo Teräs2012-01-171-1/+2
| | | | | | | | | Previously we would cache the penalty when evaluating the final solution, and adding that until we backtrack to first topology position changing that penalty. However, we can just keep track of minimum penalty based on name state, and add it. This allows us to bail out early on bad branches because we know in advance how things will turn out.
* solver, db: implement repository pinningTimo Teräs2011-10-299-0/+37
| | | | | | | | | | | | | | | | | | Improves /etc/apk/repositories format so you can say: @edge @testing After which you can pin dependencies to these tags using: apk add stableapp newapp@edge bleedingapp@testing Apk will now by default only use the untagged repositories, but adding a tag to specific dependency: 1. will prefer that tag for the name 2. allowing pulling in dependencies from that tag (though, it prefers untagged packages to satisfy deps if possible) fixes #575
* solver, pkg: implement versioned conflictsTimo Teräs2011-10-243-0/+23
| | | | | One can now say in dependency "!foo<2" which means, that if foo is installed, it needs to be >=2, but it's not a required dependency.
* solver: preference scoringTimo Teräs2011-10-144-9/+7
| | | | | Should now choose packages better if the best available version is uninstallable for some reason.
* solver: report 'complete' solutions with errorsTimo Teräs2011-09-054-10/+4
| | | | | | Allow to select packages that conflict in case we are looking for errors. This allows 'add --force' to install (on boot) the set of packages with minimum conflicts.
* solver: reintroduce install_if supportTimo Teräs2011-08-1814-12/+80
| | | | | | * each package name has two sorting positions, one which causes install_if triggers to be run, and other for bulk dependencies * fix also inverted ordering of package installations
* solver: generate proper error messagesTimo Teräs2011-08-0122-13/+56
| | | | | | | | | * the solver no longer does look-ahead locking of names (could be possibly optimized later); instead names are now always ordered strictly to properly detect the package names which are unsolveable * basic error tests added, so we can see the most likely problem in dependencies easily
* solver: don't consider package that we can't haveTimo Teräs2011-07-272-0/+1
| | | | | Packages that need (re-)installation but which are not available, are excluded now properly.
* solver: permutate each preferred solution firstTimo Teräs2011-07-275-0/+17
| | | | The first found solution is the most preferred one then.
* solver: new package selection logic (which is not yet used)Timo Teräs2011-07-2623-5/+155
| | | | | | | | | | | | | * basic code for a backtracking, forward checking dependency satisfier * works better when there are tricky dependencies to solve (when can't just upgrade everything to most preferred versions) * the new code always evaluates all of 'world' constraints (old code just does incremental updates based on heuristics) * is probably somewhat slower than old code (probably unnoticeable difference in most cases) * makes easier to write support for provides and repository pinning * test applet and a bunch of test cases added which uses the new code * from the old feature set install_if is not yet implemented
* test: check if upgrade works when package is missing in repoNatanael Copa2010-06-151-0/+7
* test: dont run sh manually but respect #!/bin/sh in each testNatanael Copa2010-06-159-10/+13
| | | | That way we can set sh options case by case
* test: initial testsuiteNatanael Copa2010-06-1517-0/+422
* test: add test cases for version comparingTimo Teras2009-11-062-0/+741
so i don't get to break version compares again.