| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changes how the scheduler works and adapts all the code that needs
adapting in order to be able to run in threads instead of in
subprocesses, which helps with Windows support, and will allow some
simplifications in the main pipeline.
This addresses the following issues:
* Fix #810: All CAS calls are now made in the master process, and thus
share the same connection to the cas server
* Fix #93: We don't start as many child processes anymore, so the risk
of starving the machine are way less
* Fix #911: We now use `forkserver` for starting processes. We also
don't use subprocesses for jobs so we should be starting less
subprocesses
And the following highlevel changes where made:
* cascache.py: Run the CasCacheUsageMonitor in a thread instead of a
subprocess.
* casdprocessmanager.py: Ensure start and stop of the process are thread
safe.
* job.py: Run the child in a thread instead of a process, adapt how we
stop a thread, since we ca't use signals anymore.
* _multiprocessing.py: Not needed anymore, we are not using `fork()`.
* scheduler.py: Run the scheduler with a threadpool, to run the child
jobs in. Also adapt how our signal handling is done, since we are not
receiving signals from our children anymore, and can't kill them the
same way.
* sandbox: Stop using blocking signals to wait on the process, and use
timeouts all the time.
* messenger.py: Use a thread-local context for the handler, to allow for
multiple parameters in the same process.
* _remote.py: Ensure the start of the connection is thread safe
* _signal.py: Allow blocking entering in the signal's context managers
by setting an event. This is to ensure no thread runs long-running
code while we asked the scheduler to pause. This also ensures all the
signal handlers is thread safe.
* source.py: Change check around saving the source's ref. We are now
running in the same process, and thus the ref will already have been
changed.
|
|
|
|
| |
pytest now provides type annotations
|
|
|
|
|
| |
This does not contain all the possible needed annotations, but just
enough to have mypy pass.
|
| |
|
| |
|
|
|
|
| |
This helps with type checking and give better feedback to mypy
|
|
|
|
| |
This enables type checking from mypy on the cython module
|
|
|
|
|
| |
These basic tests are ment to be run with a remote cache and can be used
to check bst conpatiblity with a remote cache server.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This commit:
* Adds a bare bones BuildStream pip plugin package structure at
tests/plugins/pip-samples/sample-plugins
* setup.cfg: Adds tests/plugins/pip-samples to the norecursedirs so that
we don't consider the dummy plugins as test code
|
| |
|
|
|
|
| |
CI runners sometimes need more time under load.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Generally we don't have any tests in the `src` directory so we don't
need to collect anything from that directory. The only exception to this
are the `sourcetests`, but they add their own collection hook so they
are not affected by this.
This fixes an issue where pytest gets confused upon finding two
different `conftest.py` modules - one in the `src` directory and one in
the virtual environment.
Fixes #1121.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Drop support for running tests via `setup.py test`, that is considered
deprecated. `tox` is our primary frontend for running tests, so this
change ensures that we don't have to support multiple ways of running
tests.
For testing against a specific installation environment, `tox` is not
quite practical. But in these cases, one can run `pytest` directly. So,
there is no need for this additional indirection.
This was discussed in the following mailing list thread:
https://mail.gnome.org/archives/buildstream-list/2019-December/msg00006.html.
|
|
|
|
|
|
|
| |
This sets a default timeout of 15 minutes for tests to avoid hanging
indefinitely. As the slowest test in CI normally takes less than
5 minutes, the timeout should be long enough to not trigger even on
slower systems if everything operates normally.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
All the formatting-related warnings from `pycodestyle` are covered by
Black, and almost all of the remaining ones are covered by `pylint`.
Based on that, remove `pycodestyle` so that we don't have to maintain
another set of configuration.
More details on warnings/errors covered by `pycodestyle` below.
---
Here's the big list of pycodestyle error/warning codes:
https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes. They are
broken down into following categories:
1. Indentation
2. Whitespace
3. Blank line
4. Import
5. Line Length
6. Runtime
7. Deprecation warning
8. Statement
Out of the above, 1-5 are purely formatting related so we don't needd to care
about them. 6 is runtime issues like syntax error that are hard to miss (even
mypy will complain about these). 7 is about deprecation warnings. Half of them
don't apply to us since we only support Python 3.5+ and the other half is
covered by `pylint`.
That leaves us with the "E7*" codes, that pycodestyle groups under "Statement"
heading. After verifying each of them, the only ones that is really not covered
by either Black or Pylint is the following:
* E731 do not assign a lambda expression, use a def
This sole check does not seem worth keeping another tool.
|
|
|
|
|
| |
It seems we don't need this anymore, thanks to cleaning up gRPC
background threads.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Register the marker for `pytest-datafiles`. This fixes the following
warning that we currently get:
```
.tox/py37-nocover/lib/python3.7/site-packages/_pytest/mark/structures.py:324
/Users/csingh43/buildstream/bst-tmp/.tox/py37-nocover/lib/python3.7/site-packages/_pytest/mark/structures.py:324: PytestUnknownMarkWarning: Unknown pytest.mark.datafiles - is this a typo? You can register custom marks to avoid this warning - for detail
s, see https://docs.pytest.org/en/latest/mark.html
PytestUnknownMarkWarning,
```
|
|
|
|
| |
tests: remove strict kwargs from xfail marks
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A fix was made in
https://gitlab.com/BuildStream/buildstream/merge_requests/1244
in order to set xdg_* env variables inside of the test's directory
to avoid importing data from the host.
There was however still two problems:
- When a variable was not set, it was set with a relative path, which
would create a configuration for BuildStream that is invalid.
- When a variable was set and running with pytest directly, we would
still use the variable's value, which would be the host one.
This ensure this can never happen, by not relying on the same variable's
name and always overriding them.
|
|
|
|
|
|
|
|
|
|
| |
As a first step, add type hints to variables whose type `mypy` cannot
infer automatically. This is the minimal set of type hints that allow
running `mypy` without any arguments, and having it not fail.
We currently ignore C extensions that mypy can't process directly.
Later, we can look into generating stubs for such modules (potentially
automatically).
|
| |
|
| |
|
|
|
|
| |
This fixes host contamination for tools that use HOME, e.g., bzr.
|
|
|
|
|
|
| |
This was discussed in #1008.
Fixes #1009.
|
|
|
|
| |
This fixes #966
|
|
|
|
|
|
|
| |
This disables any attempt to use coverage when running tests
directly against installed dependencies with setup.py.
This fixes #916
|
| |
|
| |
|
|
|
|
| |
configuration
|
|
|
|
|
|
|
|
| |
pep8 package was renamed to pycodestyle to reduce confusion.
Disabled warnings:
W504 - Line break after binary operator (seems people like this)
W605 - Invalid escape sequence (some of our regexes use these)
|
|
|
|
|
| |
This helps identifying what tests are slow or if the CI got stuck on
some of them
|
|
|
|
|
|
|
|
|
|
| |
This has been done in a way that I hope might be able to be upstreamed
in to versioneer. This is not garanteed but it would be good if it
could be.
Please see https://github.com/warner/python-versioneer/pull/186 and
https://github.com/wsalmonct/python-versioneer/tree/feature/regexTags
for further details.
|
|
|
|
|
|
| |
This is causing pytest to try to import the recently added app1.py
from the pip related tests. This fails because it's not meant to be
imported outside of the sandbox environment.
|
|
|
|
| |
This allows code generation with ./setup.py build_grpc
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Using setuptools_scm had a couple of bad problems:
o Unexpected versioning semantics, setuptools_scm would
increment the micro version by itself in the case that
we derive a version number from something that is not a tag,
making the assumption that we are "leading up to" the next
micro version.
People mostly dont expect this.
o When installing in developer mode, i.e. with `pip3 install --user -e .`,
then we were always picking the generated version at install time
and never again dynamically resolving it.
Many of our users install this way and update through git, so it's
important that we report more precise versions all the time.
This commit needs to make a series of changes at the same time:
o Adds versioneer.py to the toplevel, this is used by setup.py
for various activities.
This is modified only to inform the linter to skip
o Adds buildstream/_version.py, which is generated by versioneer
and gives us the machinery to automatically derive the correct version
This is modified only to inform the linter to skip
o Adds a .gitattributes file which informs git to substitute
the buildstream/_version.py file, this is just to ensure that
the versioning output would work if ever we used `git archive`
to release a tarball.
o Modifies setup.py and setup.cfg for versioneer
o Modifies utils.py and _frontend/cli.py such as to avoid importing
the derived version when running bash completion mode, we dont
derive the version at completion time because this can result
in running a subprocess (when running in developer install mode)
and is an undesirable overhead.
o Updates tests/frontend/version.py to expect changed version output
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
For some reason, an undesired .eggs/ directory gets created
at times by the incomprehensible pip/setuptools machinery.
This makes sure it doesnt cause noise in our tests.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The upstream of fuse.py is <https://github.com/terencehonles/fusepy>. It looks
pretty abandoned -- there have been no commits there since 5th April 2016 and
there are 17 pull requests dating from 2013 onwards that are still waiting for
responses from the maintainer.
There's no support in fuse.py for ppc64 platforms which means BuildStream is
unusable on that architecture at present. My pull request to fix that upstream
is being ignored; since the module is a single .py file provided under the
ISC license it is simplest to pull the whole thing into buildstream.git instead.
The version of fuse.py that's been embedded is the one from pull request #72,
from upstream release v2.0.4 (commit 0eafeb5).
|
|
|
|
| |
Turns out we do need this in some corner cases
|
|
|
|
|
|
|
| |
Turns out this doesnt work once you try to actually
run the full buildstream in a test case (in foreground
it screws with other parsing, in background it fails
in the test context with a strange error).
|
| |
|
| |
|
|
|
|
| |
Ignore multiline statement has same indentation as next logical line.
|
|
|
|
|
| |
Pep8 should not be run on all files in the basedir. Adding
an ignore rule for if a virtual env directory exists.
|
| |
|