summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* buildelement.py: Remove secret undocumented command listsremove-secret-command-lists-backportTristan Van Berkom2018-01-121-5/+17
| | | | | | | | | | | | | | | | | | Originally this was created with also `bootstrap-commands` and `test-commands` but these were never documented or used. For `bootstrap-commands`, these originated in baserock but are basically a part of the `configure-commands` stage, prepending commands to `configure-commands` is more suitable here since we now have the prepend/append list directives. For `test-commands`, these were never used and it's unclear at this time if it's the correct place for it. It would be interesting to implement `test-commands` as a separate operation which can run in parallel with reverse dependency builds (no need to block the build of a reverse dependency on failing tests, we can still fail the build as a whole based on a failing test without blocking builds).
* _frontend/main.py: Making error handling more consistentTristan Van Berkom2018-01-121-16/+27
| | | | | | | | Added app.print_error() to consistently print an error while running the pipeline stuff. Also make bst push & pull commands more consistent with the rest, and print the summary at the end as expected.
* _frontend/widget.py: Change how we format failure messages.Tristan Van Berkom2018-01-121-11/+20
| | | | | | | | | | | | | | | | o Now print the message itself on the same line in place of the abbreviated log file o When reading back the last lines of the log file, prefix that with an informative message about whence the log lines come, showing the full unabbreviated log file. o Fixed the behavior of read_last_lines() so that it works as intended, problems were: - Was prepending an additional newline when the log contains more lines than we want to print - Was not printing anything at all in the case we want to print more lines than exist in the log
* _exceptions.py: Added `detail` member to base BstError class.Tristan Van Berkom2018-01-111-3/+8
| | | | | | | Now any BuildStream exception can potentially add detail to the errors they raise. Allow detail strings already in PluginError()
* _pipeline.py: Only raise the error for inconsistent pipelineTristan Van Berkom2018-01-111-2/+1
| | | | | Dont make the ERROR message explicitly anymore, leave that to the frontend to sort out.
* _message.py: Remove MessageType.ERROR, we have no need for this.Tristan Van Berkom2018-01-111-2/+0
|
* _scheduler/trackqueue.py: Dont use Plugin.error(), use Plugin.warn() for now.Tristan Van Berkom2018-01-112-6/+11
| | | | | | | This is already problematic as this particular error is reported but fails to fail the session correctly. Documented this in issue #187
* plugin.py: Removing Plugin.error() while it's still early and nobody is ↵Tristan Van Berkom2018-01-111-9/+0
| | | | | | | | | | using it. Errors are fatal, as such plugins must raise either SourceError() or ElementError(). This method was never used in plugins so far, lets remove it even though we are technically breaking (unused) API for the overall betterment of the API.
* _artifactcache/ostreecache.py: Handle ^C and shutdown child task when ↵tristan/fix-cache-initTristan Van Berkom2018-01-111-6/+16
| | | | | | initializing cache This fixes issue #141
* tests/cachekey/cachekey.py: Manually create a symlink for our testsTristan Van Berkom2018-01-101-0/+10
| | | | | | | | This works around an inconsistent behavior with setuptools. Newer versions of setuptools fail to preserve symbolic links when creating a source distribution, meaning that tests run from the dist tarball will fail.
* tests/cachekey: Enhanced tests to consider local sources with multiple files.Tristan Van Berkom2018-01-1016-13/+16
| | | | | | | We had a cache key instability issue with local sources generating inconsistent cache keys due to iterating over their files in a random order. Tests did not catch this previously due to the local source sample only using one file to iterate over.
* plugins/sources/local.py: Consider symbolic link target in cache key.Tristan Van Berkom2018-01-101-1/+2
| | | | | | | | Technically this breaks cache keys for the local source, but as this comes in a branch which fixes local source cache keys to be stable (they were random before this branch), we wont bother with considering this enhancement a separate API break, the cache key breakage was inescapable anyway.
* utils.py: Make list_relative_paths() report sorted paths.Tristan Van Berkom2018-01-101-15/+26
| | | | | | | | | | | This is needed because plugins make use of this function to generate a cache key which must be stable. In addition to the above, this patch also mitigates the performance hit of sorting, and allows _process_list() to function to iterate through the generator when additional sorting is not needed. This patch is an enhanced version of Sam Thursfield's patch on MR !216
* doc/source/projectconf.rst: Documenting plugin loading section.Tristan Van Berkom2018-01-082-55/+88
| | | | | | | | | | | | | This fixes issue #183. Also move the `format-version` related documentation to the first section "Essentials", beside the project name and element path, since this is a quite global option it belongs here and not hidden away with the plugin loading documentation. Also adjust the main index.rst to include the plugins sub-section as an adjacent sub-point of the project configuration (consistent with other project configuration sections).
* tests/pipeline/preflight.py: Added test to ensure graceful exit at preflight ↵fix-preflight-errors-backportTristan Van Berkom2018-01-065-0/+69
| | | | error time
* _pipeline.py: Raise detailed pipeline error at preflight timeTristan Van Berkom2018-01-061-2/+11
| | | | | If a plugin raises an error, prepend the plugin identifier to the error message and raise PipelineError.
* _frontend/main.py: Fix issue #180 - Fail gracefully when preflight failsTristan Van Berkom2018-01-061-21/+18
| | | | | | | This also makes main.py less redundant, for some reason there was a stray call to app.pipeline.initialize() beside app.initialize() in every function, instead move that into app.initialize() where we now handle the error and exit gracefully.
* local & patch source tests: Preflight errors now report PipelineErrorTristan Van Berkom2018-01-062-3/+3
|
* tests/testutils/runcli.py: Assert that buildstream actually exited.Tristan Van Berkom2018-01-061-0/+12
| | | | | | Enhanced the error checking Result() methods to always assert that the CLI actually exited, there are no cases worth testing for where buildstream would be expected to exit on an unhandled exception.
* tests/pipeline/load.py: Removing unused tmpdir fixture from hereTristan Van Berkom2018-01-061-7/+7
|
* doc/source/install.rst: Silence a docs generation errorTristan Van Berkom2018-01-041-2/+2
| | | | | | Fixes the warning: WARNING: /path/to/buildstream/doc/source/install.rst:45: (WARNING/2) Title underline too short.
* source.py & element.py: Fixing SourceError() and ElementError() constructors.Tristan Van Berkom2018-01-042-6/+12
| | | | | | | | Recently I added the `reason` member which can be used to set machine readable error reason strings for the purpose of testing. Forgot to add the necessary `*` argument, forcing `reason` to be a keyword-only argument.
* setup.py: Removing explicitly set version, we use setuptools_scm for this.Tristan Van Berkom2018-01-031-1/+0
|
* Added MAINTAINERS, NEWS and BuildStream.doap1.0.0Tristan Van Berkom2018-01-034-2/+60
| | | | Some basic module metadata before publishing the 1.0 release.
* .gitlab-ci.yml: Force colors in pytest for better output in the gitlab UI.error-codesTristan Van Berkom2018-01-021-0/+3
|
* plugins/sources/_downloadablefilesource.py: Exclude a line from coverageTristan Van Berkom2018-01-021-1/+6
| | | | | | | When fetching a downloadable source, we make a defensive check to avoid redundant download at fetch() time by checking if it's already cached, but fetch() will never be called if the source is already cached.
* tests/sources/local.py: Adding test for staging a symlink.Tristan Van Berkom2018-01-024-0/+34
| | | | | This has remained without test coverage mostly due to upstream pytest-datafiles bug https://github.com/omarkohl/pytest-datafiles/issues/1
* tests/sources/local.py: Testing failures to create staging directoriesTristan Van Berkom2018-01-024-0/+28
| | | | | | | | Seems that local.py is an appropriate plugin to use for testing errors which originate from the abstract Source class. This test checks that we raise the appropriate error in the case that we attempt to stage to a directory that is a regular file.
* plugins/sources/local.py: pragma nocover on unreachable codeTristan Van Berkom2018-01-021-3/+3
| | | | | | | | The local plugin is always Consistency.CACHED, this means that fetch(), set_ref() and get_ref() methods will never be called. Instead of omitting them, just "pragma: nocover" on the `pass` statements, making our coverage report more realistic.
* plugins/sources/patch.py: Removing unneeded checkTristan Van Berkom2018-01-021-7/+5
| | | | | | | | | The patch plugin was checking if the target directory exists, however this is automatically guaranteed by the Source abstract class and documented to be guaranteed as well. Since this error cannot be caught by the plugin (it will be caught in advance by the Source class), removing the check from patch.py.
* source.py: Raise proper SourceError() when failing to create the staging ↵Tristan Van Berkom2018-01-021-1/+7
| | | | | | | directory This changes the UX to report a better human readable error, which is otherwise a BUG message with stack trace.
* tests/frontend: Updating tests to use new error checksTristan Van Berkom2018-01-0112-57/+50
| | | | | This also fixes #177 - the problem here was solved simply by passing the project directory to `cli.run(project=project...)`
* tests/format: Use new error assertions all aroundTristan Van Berkom2018-01-0111-120/+50
|
* tests/cachekey/cachekey.py: Use new error checkingTristan Van Berkom2018-01-011-5/+1
|
* tests/sources: Use new error checking tools for source testsTristan Van Berkom2018-01-016-82/+91
| | | | | | Also added a test case for the `patch` plugin which checks for graceful failure when the specified patch file is not a regular file (but a block device or a named pipe instead).
* tests/testutils/runcli.py: Augment the Result object to store task errorsTristan Van Berkom2018-01-011-9/+100
| | | | | | | | | | | | Before this, we only stored the last exception to have been raised in the main process, now we additionally provide some Result members allowing tests to inspect a machine readable error `domain` and `reason` describing why a task has "failed". This adds some new APIs to the Result() object for tests: assert_main_error() - asserts the nature of the main buildstream error assert_task_error() - asserts the nature of the error from a child task
* plugins/sources/patch.py: Added context to some errorsTristan Van Berkom2018-01-011-8/+12
|
* _pipeline.py: Added context to some errorsTristan Van Berkom2018-01-011-1/+1
|
* Exceptions refactoringTristan Van Berkom2017-12-296-24/+100
| | | | | | | | | | | | | | | Outline of changes to exceptions: o Now BstError base class has a `domain` and `reason` member, reason members are optional. o All derived error classes now specify their `domain` o For LoadError, LoadErrorReason defines the error's `reason` o Now the scheduler `job` class takes care of sending the error reason and domain back to the main process where the last exception which caused a child task to fail can be discretely stored.
* .gitlab-ci.yml: Build documentation in every CI pipelineci-on-docsTristan Van Berkom2017-12-221-24/+58
| | | | | Build it in one stage before the `pages` target, and then only make the deployment step conditional on the branch.
* _signals.terminator_handler: wrap handlers in trysAngelos Evripiotis2017-12-221-1/+14
| | | | | | | | It's possible for the custom termination handlers to raise exceptions. Indeed this was actually the case for utils._call(). They're especially difficult to reach with tests, so make extra effort to insulate them. Print any exceptions encountered as a regular traceback before exiting.
* utils._call: rm unused assignments to exit_codeAngelos Evripiotis2017-12-221-2/+1
|
* utils._call: fix race condition on 'process' varAngelos Evripiotis2017-12-221-0/+2
| | | | | | | | | | Tested by inflating the chance of hitting the race. First, insert a sleep between opening the terminator context and starting the process, then: python3 -c 'import buildstream.utils; import os; \ buildstream.utils._call(["echo", "hello"], True); \ print(os.getpid())' & sleep 1; kill $!
* utils._call: fix doc typoAngelos Evripiotis2017-12-221-1/+1
|
* .gitlab-ci.yml: Use latest BuildStream Docker imageSam Thursfield2017-12-211-1/+1
| | | | | Integration tests were failing as the installed version of BuildStream didn't support the new --hardlinks option.
* plugins/sources/tar.py: Dont manually reraise exceptionTristan Van Berkom2017-12-201-5/+4
| | | | | It's not required to raise SourceError() manually when calling utils.get_host_tool().
* Fixing tests to adapt to new setup of ProgramNotFound exceptionTristan Van Berkom2017-12-202-6/+4
|
* _artifactcache/tarcache.py: Fixed for new location of ProgramNotFoundErrorTristan Van Berkom2017-12-201-2/+2
|
* utils.py: Add UtilErrorTristan Van Berkom2017-12-203-52/+84
| | | | | | | | | | | | | | | | | Report UtilError instead of OSError and similar python errors. Also ensure we catch system errors and raise UtilError with descriptive text instead; for the user experience; this is the difference between: o A FAILURE message with a description as to what went wrong (exception handled with UtilError) o A BUG message with the unhandled system error printed with a stack trace (exception left unhandled) Also, UtilsError and ProgramNotFoundError are now public exceptions declared in utils.py, where they will appear in the documentation.
* project: Export the name as a variableproject-nameMathieu Bridon2017-12-201-0/+3
| | | | | This is often useful, for example when the main element needs to do something with a path like /etc/%{project-name}/ .