summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* .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}/ .
* Fix a "TypeError: 'dict' object is not callable" in _plugincontext.pyValentin David2017-12-201-1/+1
|
* doc: Add cache key documentationjuerg/cache-key-docJürg Billeter2017-12-202-0/+100
|
* project: Rename required-project-version to format-versionJonathan Maw2017-12-143-5/+5
|
* project: Reduce code duplication when storing originsJonathan Maw2017-12-141-25/+33
|
* doc: Remove stray documentation of obsolete required-versions fieldsJonathan Maw2017-12-141-18/+0
|
* _plugincontext.py: Let plugins not have YAML defaultsMathieu Bridon2017-12-141-4/+8
| | | | | Source plugins typically do not have an accompanying YAML file with their default settings.
* element.py: Removing the exclamation mark from the overlaps warningTristan Van Berkom2017-12-131-1/+1
|
* integration-tests: Use bst_checkout() everywhereintegration-tests-hardlinksTristan Van Berkom2017-12-1310-11/+11
|
* integration-tests/lib.sh: Added bst_checkout()Tristan Van Berkom2017-12-131-0/+17
| | | | | | This calls bst_with_flags checkout in a uniform way, we use it for now to pass `--hardlinks` to all checkouts potentially speeding up the test runs.
* tests: Test whether a plugin is allowed to be loadedfix-132-rebasedJonathan Maw2017-12-1311-1/+62
|
* Update tests for changed plugin loadingJonathan Maw2017-12-1317-103/+225
| | | | | | Checking for plugins with the same name no longer happens in the plugincontext, it happens in project, so the old test was removed and a new one added.
* Make external plugin loading require explicit configuration in project.confJonathan Maw2017-12-136-146/+216
| | | | | | In addition, it changes the "plugins" and "required-versions" fields, combining them for plugins and adding a new "required-project-version" field.
* _signals: always pop handlers, and restore statesAngelos Evripiotis2017-12-131-19/+23
|
* utils._tempdir: don't leak on exceptionsAngelos Evripiotis2017-12-131-4/+5
|
* source: clarify note on why to use this tmpdir()Angelos Evripiotis2017-12-131-3/+4
|
* _signals: note os._exit() on terminateAngelos Evripiotis2017-12-131-0/+4
| | | | | Make it explicit that we should not rely on 'finally' clauses to clean up for us in the event of termination.
* Adapting test cases to expect logs in stderrTristan Van Berkom2017-12-139-38/+27
| | | | And also adapted them to remove any occurrences of HAVE_ROOT.
* tests/testutils/site.py: Removed HAVE_ROOTTristan Van Berkom2017-12-131-2/+0
| | | | | There is no scenario worth testing where this condition is not true, removing this.
* tests/testutils/runcli.py: Enhanced to capture stdout/stderr separatelyTristan Van Berkom2017-12-131-11/+64
| | | | | We need this now in order to properly test the frontend and parse logs from stderr or output from stdout.
* _frontend: Enable logging right away, fixes issue #168Tristan Van Berkom2017-12-133-149/+54
| | | | | | | | | | | Now we just assume that logging is turned on all the time, any messages must now always go through the central context messaging APIs. As a side effect, we now send all output messages that buildstream generates to stderr, leaving stdout only to payload types of output, such as parsible `bst show` output, the output of `bst workspace list` or `bst shell`.
* _pipeline.py: Removed tickers, use timed activities insteadTristan Van Berkom2017-12-131-54/+38
| | | | | | | | Currently this does not update the task list, and is for timing groups of activities from the frontend, or for timing long standing tasks which run directly in the frontend and not in a child task (like downloading the refs from a remote at load time before a build commences).
* plugin.py: Implement Plugin.timed_activity() using Context._timed_activity()Tristan Van Berkom2017-12-131-33/+5
|
* _context.py: Added _timed_activity() methodTristan Van Berkom2017-12-131-1/+53
| | | | A version of the function which can be shared with the frontend too.
* _frontend/main.py: Rewording `--track-all` build optionTristan Van Berkom2017-12-131-2/+2
|