Skip to content

Commit

Permalink
Merge branch 'master' into archived-queries
Browse files Browse the repository at this point in the history
  • Loading branch information
jezdez authored Dec 18, 2018
2 parents c3a82bd + 8583eaa commit 328aa69
Show file tree
Hide file tree
Showing 255 changed files with 3,220 additions and 989 deletions.
81 changes: 28 additions & 53 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2.0
flake8-steps: &steps
- checkout
- run: sudo pip install flake8
- run: ./flake8_tests.sh
- run: ./bin/flake8_tests.sh
jobs:
python-flake8-tests:
docker:
Expand Down Expand Up @@ -34,7 +34,7 @@ jobs:
command: docker-compose run --rm postgres psql -h postgres -U postgres -c "create database tests;"
- run:
name: Run Tests
command: docker-compose run --name tests redash tests --junitxml=junit.xml tests/
command: docker-compose run --name tests redash tests --junitxml=junit.xml --cov-report xml --cov=redash --cov-config .coveragerc tests/
- run:
name: Copy Test Results
command: |
Expand All @@ -54,16 +54,38 @@ jobs:
- run: npm install
- run: npm run bundle
- run: npm test
frontend-e2e-tests:
environment:
COMPOSE_FILE: .circleci/docker-compose.cypress.yml
COMPOSE_PROJECT_NAME: cypress
PERCY_TOKEN_ENCODED: MWM3OGUzNzk4ZWQ2NTE4YTBhMDAwZDNiNWE1Nzc4ZjEzZjYyMzY1MjE0NjY0NDRiOGE5ODc5ZGYzYTU4ZmE4NQ==
docker:
- image: circleci/node:8
steps:
- setup_remote_docker
- checkout
- run:
name: Install npm dependencies
command: |
npm install
- run:
name: Setup Redash server
command: |
npm run cypress start
docker-compose run cypress node ./cypress/cypress.js db-seed
- run:
name: Execute Cypress tests
command: npm run cypress run-ci
build-tarball:
docker:
- image: circleci/node:8
steps:
- checkout
- run: sudo apt install python-pip
- run: npm install
- run: .circleci/update_version
- run: npm run bundle
- run: npm run build
- run: .circleci/update_version
- run: .circleci/pack
- store_artifacts:
path: /tmp/artifacts/
Expand All @@ -77,64 +99,15 @@ jobs:
- run: docker login -u $DOCKER_USER -p $DOCKER_PASS
- run: docker build -t redash/redash:$(.circleci/docker_tag) .
- run: docker push redash/redash:$(.circleci/docker_tag)
integration-tests:
working_directory: ~/redash
machine: true
environment:
REDASH_SERVER_URL : "http://127.0.0.1:5000/"
DOCKER_IMAGE: mozilla/redash-ui-tests
steps:
- checkout
- run:
name: Install Docker Compose
command: |
set -x
pip install --upgrade pip
pip install docker-compose>=1.18
docker-compose --version
- run:
name: Pull redash images
command: |
set -x
docker-compose -f docker-compose.yml up --no-start
sleep 10
- run:
name: Pull redash-ui-tests
command: docker pull "${DOCKER_IMAGE}":latest
- run:
name: Setup redash instance
command: |
set -x
docker-compose run --rm --user root server create_db
docker-compose run --rm postgres psql -h postgres -U postgres -c "create database tests"
docker-compose run --rm --user root server /app/manage.py users create_root root@example.com "rootuser" --password "IAMROOT" --org default
docker-compose run --rm --user root server /app/manage.py ds new "ui-tests" --type "url" --options '{"title": "uitests"}'
docker-compose run -d -p 5000:5000 --user root server
docker-compose start postgres
docker-compose run --rm --user root server npm install
docker-compose run --rm --user root server npm run bundle
docker-compose run --rm --user root server npm run build
- run:
name: Run tests
command: |
set -x
docker run --net="host" --env REDASH_SERVER_URL="${REDASH_SERVER_URL}" "${DOCKER_IMAGE}"
- store_artifacts:
path: report.html
workflows:
version: 2
# integration_tests:
# jobs:
# - integration-tests:
# filters:
# branches:
# only: master
build:
jobs:
- python-flake8-tests
- legacy-python-flake8-tests
- backend-unit-tests
- frontend-unit-tests
- frontend-e2e-tests
- build-tarball:
requires:
- backend-unit-tests
Expand All @@ -151,4 +124,6 @@ workflows:
filters:
branches:
only:
- master
- preview-build
- /release\/.*/
47 changes: 47 additions & 0 deletions .circleci/docker-compose.cypress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
version: '3'
services:
server:
build: ../
command: dev_server
depends_on:
- postgres
- redis
ports:
- "5000:5000"
environment:
PYTHONUNBUFFERED: 0
REDASH_LOG_LEVEL: "INFO"
REDASH_REDIS_URL: "redis://redis:6379/0"
REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres"
worker:
build: ../
command: scheduler
depends_on:
- server
environment:
PYTHONUNBUFFERED: 0
REDASH_LOG_LEVEL: "INFO"
REDASH_REDIS_URL: "redis://redis:6379/0"
REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres"
QUEUES: "queries,scheduled_queries,celery"
WORKERS_COUNT: 2
cypress:
build:
context: ../
dockerfile: Dockerfile.cypress
depends_on:
- server
- worker
environment:
CYPRESS_baseUrl: "http://server:5000"
PERCY_TOKEN: ${PERCY_TOKEN}
PERCY_BRANCH: ${CIRCLE_BRANCH}
PERCY_COMMIT: ${CIRCLE_SHA1}
PERCY_PULL_REQUEST: ${CIRCLE_PR_NUMBER}
redis:
image: redis:3.0-alpine
restart: unless-stopped
postgres:
image: postgres:9.5.6-alpine
command: "postgres -c fsync=off -c full_page_writes=off -c synchronous_commit=OFF"
restart: unless-stopped
9 changes: 7 additions & 2 deletions .circleci/docker_tag
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/bash
VERSION=$(jq -r .version package.json)
FULL_VERSION=$VERSION.b$CIRCLE_BUILD_NUM
if [ $CIRCLE_BRANCH = master ] || [ $CIRCLE_BRANCH = preview-build ]
then
FULL_VERSION='preview'
else
VERSION=$(jq -r .version package.json)
FULL_VERSION=$VERSION.b$CIRCLE_BUILD_NUM
fi

echo $FULL_VERSION
3 changes: 2 additions & 1 deletion .circleci/update_version
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
VERSION=$(jq -r .version package.json)
FULL_VERSION=$VERSION+b$CIRCLE_BUILD_NUM

sed -ri "s/^__version__ = '([A-Za-z0-9.-]*)'/__version__ = '$FULL_VERSION'/" redash/__init__.py
sed -ri "s/^__version__ = '([A-Za-z0-9.-]*)'/__version__ = '$FULL_VERSION'/" redash/__init__.py
sed -i "s/dev/$CIRCLE_SHA1/" client/app/version.json
34 changes: 0 additions & 34 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/---bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: "\U0001F41B Bug report"
about: Report reproducible software issues so we can improve
---

<!--
We use GitHub only for bug reports 🐛
Anything else should be posted to https://discuss.redash.io 👫
🚨For support, help & questions use https://discuss.redash.io/c/support
💡For feature requests & ideas use https://discuss.redash.io/c/feature-requests
**Found a security vulnerability?** Please email security@redash.io to report any security vulnerabilities. We will acknowledge receipt of your vulnerability and strive to send you regular updates about our progress. If you're curious about the status of your disclosure please feel free to email us again. If you want to encrypt your disclosure email, you can use this PGP key.
-->

### Issue Summary

A summary of the issue and the browser/OS environment in which it occurs.

### Steps to Reproduce

1. This is the first step
2. This is the second step, etc.

Any other info e.g. Why do you consider this to be a bug? What did you expect to happen instead?

### Technical details:

* Redash Version:
* Browser/OS:
* How did you install Redash:
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/--anything_else.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: "\U0001F4A1Anything else"
about: "For help, support, features & ideas - please use https://discuss.redash.io \U0001F46B "
labels: "Support Question"
---

We use GitHub only for bug reports 🐛

Anything else should be posted to https://discuss.redash.io 👫

🚨For support, help & questions use https://discuss.redash.io/c/support
💡For feature requests & ideas use https://discuss.redash.io/c/feature-requests

Alternatively, check out these resources below. Thanks! 😁.

- [Forum](https://disucss.redash.io)
- [Knowledge Base](https://redash.io/help)
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ node_modules
.sass-cache
npm-debug.log

cypress/screenshots
cypress/videos
Loading

0 comments on commit 328aa69

Please sign in to comment.