Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How should I run bazel tests ? #40

Closed
eLvErDe opened this issue Mar 13, 2018 · 10 comments
Closed

How should I run bazel tests ? #40

eLvErDe opened this issue Mar 13, 2018 · 10 comments

Comments

@eLvErDe
Copy link

eLvErDe commented Mar 13, 2018

Hi there,

I added the WORKSPACE file from GitHub into the package published on pypi, but when I run

bazel test absl

It says:

ERROR: no targets found beneath 'absl'.
INFO: Elapsed time: 0.105s
ERROR: Couldn't start the build. Unable to run tests.

Thanks

@yilei
Copy link
Contributor

yilei commented Mar 13, 2018

Hi,

The package published on PyPI doesn't include tests nor bazel BUILD files. If you are interested in running tests, you can clone the repo then run bazel:

git clone git@github.com:abseil/abseil-py.git
cd abseil-py
bazel test absl/...

I'll update the README.md files so it's more clear.

@eLvErDe
Copy link
Author

eLvErDe commented Mar 13, 2018

Any reason why this is excluded from pypi release ?

@yilei
Copy link
Contributor

yilei commented Mar 13, 2018

We don't want to pollute the PyPI library with the tests, since they are not part of the API we provide. Plus, the tests require bazel, which isn't a thing you would run inside a pip installed directory.

@eLvErDe
Copy link
Author

eLvErDe commented Mar 13, 2018

Fair enough, but distributions integrating absl could be interested in running the testsuite (my case)

@yilei yilei closed this as completed in 1b30098 Mar 13, 2018
@yilei
Copy link
Contributor

yilei commented Mar 13, 2018

Right now our tests aren't structured to be run without bazel, and we also don't want to add bazel as an extra dependency for things related to the PyPI distribution.

I think it's technically possible to run at least some of the tests without bazel, and provide them as part of PyPI test suites. But we are not there yet.

@eLvErDe
Copy link
Author

eLvErDe commented Mar 13, 2018

It's fine to run them through bazel, this is only required to build the original package and provide a proof that the code it's working fine. It won't be required when installing the binary package (exactly the same as Sphinx and various "heavy" documentation system).
Anyway, could you create a GitHub tag matching pypi releases ? That would be a perfect workaround for people looking for source code along the matching test suite. Thanks

@yilei yilei reopened this Mar 13, 2018
@yilei
Copy link
Contributor

yilei commented Mar 15, 2018

git-tags are indeed useful.

We'd like to create tags named like pypi-v0.1.10, pypi-v0.1.11. Would this work for you?

We want to emphasize that these are for mapping PyPI releases only, and de-emphasize the concept of versions for users who directly depend on source code. Hence the prefix pypi-.

@yilei
Copy link
Contributor

yilei commented Mar 16, 2018

A git-tag is created for the latest PyPI release. Future releases will also include such tags.

@yilei yilei closed this as completed Mar 16, 2018
@jayvdb
Copy link

jayvdb commented Feb 26, 2019

rpm packaging is done within a VM without internet access.

When I try testing with bazel, it attempts to fetch lots of packages from the internet.

Is there any way to use bazel without internet ? Pre-fetching all of the dependencies and including them in the rpm SOURCES?

@jayvdb jayvdb mentioned this issue Feb 26, 2019
@rickeylev
Copy link
Contributor

rickeylev commented Feb 27, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants