-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Run all S3 tests on travis #1790
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
Comments
Hey @lopuhin! #rest of the test
uri = "s3://test.bucket/scrapy-test"
#or we can set S3_TEST_FILE_URI to this in tox.ini
store = S3FilesStore(uri)
store.port = 4567
store.host = 'localhost'
#rest of the test (We can start the flask-s3 server at port Am I on the correct path? |
Hey @darshanime , I think your approach is correct, please go ahead! Maybe it would also be nice to check that |
It may be better to start fake-s3 server as a pytest fixture, better on a random port. We have technical debt in Scrapy already though with mockserver and mitmproxy - they run on fixed ports, and this makes it impossible to execute tests in parallel. I also wonder how good is https://github.com/spulec/moto - it seems to have server mode. |
Hey @kmike, @lopuhin! from moto import mock_s3
class TestS3FilesStore(unittest.TestCase):
@pytest.fixture(autouse=True)
def setup_s3(self):
mock = mock_s3()
mock.start()
conn = boto.connect_s3()
bucket = conn.create_bucket('test.bucket')
#rest of the test The tests passed when I ignored the |
Hey @darshanime - with mock_s3 we won't be able to test botocore, so it is worse than fake-s3; but maybe we can use moto in server mode for tests if it provides a server which emulates s3 like fake-s3. |
Yes, it does have a stand-alone server mode. Is it okay to start it using |
@darshanime subprocess / Popen is fine |
Hi! I came across a problem when using os.environ["HTTP_PROXY"] = "127.0.0.1:5000"
os.environ["HTTPS_PROXY"] = "127.0.0.1:5000"
subprocess.Popen(["moto_server", "s3"])
#using boto, bucket successfully created when the connection is initialized thus:
conn = boto.connect_s3("", "", is_secure=False, proxy_port = 5000, proxy ="127.0.0.1")
bucket = conn.create_bucket('test.bucket') However, when the test runs, the botocore demands this link from the moto_server which ends with a 404, failing the test.
|
Hi, For the record, several months ago, I wrote some code for testing For |
I see |
Specific S3 tests that seem to be skipped with local
|
I think we should postpone this work until after #1866 is implemented. |
There are some tests S3 that are currently skipped on travis (
S3FeedStorageTest
,TestS3FilesStore
) because they need real S3. It would be nice to run them, here are some options:From discussion here: #1761 (comment)
The text was updated successfully, but these errors were encountered: