Browse Source

Add test suite that requires network. (#5818)

* Add test suite that requires network.

* lol Makefile

* Add install command.

* Need Redis etc.

* Need lint rule.
Brett Hoerner 7 years ago
parent
commit
de81a7465b
3 changed files with 26 additions and 0 deletions
  1. 6 0
      .travis.yml
  2. 11 0
      Makefile
  3. 9 0
      tests/network/test_thing.py

+ 6 - 0
.travis.yml

@@ -66,6 +66,12 @@ matrix:
         - memcached
         - redis-server
         - postgresql
+    - python: 2.7
+      env: TEST_SUITE=network DB=postgres
+      services:
+        - memcached
+        - redis-server
+        - postgresql
     - python: 2.7
       env: TEST_SUITE=mysql DB=mysql
       services:

+ 11 - 0
Makefile

@@ -121,6 +121,14 @@ test-python:
 	py.test tests/integration tests/sentry || exit 1
 	@echo ""
 
+test-network:
+	@echo "--> Building platform assets"
+	sentry init
+	@echo "from sentry.utils.integrationdocs import sync_docs; sync_docs()" | sentry exec
+	@echo "--> Running network tests"
+	py.test tests/network
+	@echo ""
+
 test-acceptance:
 	@echo "--> Building static assets"
 	@${NPM_ROOT}/.bin/webpack
@@ -188,6 +196,7 @@ travis-install-mysql: travis-install-python
 	pip install mysqlclient
 	echo 'create database sentry;' | mysql -uroot
 travis-install-acceptance: install-yarn travis-install-postgres
+travis-install-network: travis-install-postgres
 travis-install-js:
 	$(MAKE) travis-upgrade-pip
 	$(MAKE) install-python install-yarn
@@ -206,6 +215,7 @@ travis-lint-sqlite: lint-python
 travis-lint-postgres: lint-python
 travis-lint-mysql: lint-python
 travis-lint-acceptance: travis-noop
+travis-lint-network: lint-python
 travis-lint-js: lint-js
 travis-lint-cli: travis-noop
 travis-lint-dist: travis-noop
@@ -220,6 +230,7 @@ travis-test-sqlite: test-python-coverage
 travis-test-postgres: test-python-coverage
 travis-test-mysql: test-python-coverage
 travis-test-acceptance: test-acceptance
+travis-test-network: test-network
 travis-test-js: test-js
 travis-test-cli: test-cli
 travis-test-dist:

+ 9 - 0
tests/network/test_thing.py

@@ -0,0 +1,9 @@
+from __future__ import absolute_import
+
+from sentry.constants import INTEGRATION_ID_TO_PLATFORM_DATA
+from sentry.testutils import TestCase
+
+
+class ThingTest(TestCase):
+    def test_thing(self):
+        assert len(INTEGRATION_ID_TO_PLATFORM_DATA) > 0