Skip to content

Commit b75fb6a

Browse files
authored
Merge pull request #1 from CSCfi/feature/github-integrations
Add travis integration
2 parents 22419e6 + 436dffc commit b75fb6a

File tree

10 files changed

+218
-3
lines changed

10 files changed

+218
-3
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
#### Describe the bug
11+
<!-- A clear and concise description of what the bug is. -->
12+
13+
#### To Reproduce
14+
Steps to reproduce the behaviour:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
#### Expected behavior
21+
<!-- A clear and concise description of what you expected to happen. -->
22+
23+
#### Screenshots
24+
<!-- If applicable, add screenshots to help explain your problem. -->
25+
26+
#### Additional context
27+
<!-- Add any other context about the problem here. -->
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
#### Proposed solution
11+
<!-- A clear and concise description of what you want to happen. -->
12+
13+
#### DoD (Definition of Done)
14+
<!-- How to know this is implemented. Preferably one short sentence. -->
15+
16+
#### Testing
17+
<!-- How can someone else verify the task, can be test-suite or something else. -->
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: General issue template
3+
about: Describe this issue template's purpose here.
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
#### Description
11+
<!-- A clear and concise description of what you want to happen. -->
12+
13+
#### DoD (Definition of Done)
14+
<!-- How to know this is implemented. Preferably one short sentence. -->
15+
16+
#### Testing
17+
<!-- How can someone else verify the task, can be test-suite or something else. -->

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
### Description
2+
3+
<!-- Please include a summary of the change or any information deemed important. -->
4+
5+
### Related issues
6+
<!-- Reference any follow up issues with "Fixes #<issue-num>." -->
7+
8+
### Type of change
9+
10+
<!-- Replace [ ] with [x] to select options. -->
11+
<!-- Please delete options that are not relevant. -->
12+
13+
- [ ] Bug fix (non-breaking change which fixes an issue)
14+
- [ ] New feature (non-breaking change which adds functionality)
15+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
16+
- [ ] This change requires a documentation update (this needs a follow up PR)
17+
18+
### Changes Made
19+
20+
<!-- List changes made. -->
21+
22+
### Testing
23+
24+
<!-- Are any tests part of this PR. -->
25+
<!-- Replace [ ] with [x] to select options. -->
26+
<!-- Please delete options that are not relevant. -->
27+
28+
- [ ] Unit Tests
29+
- [ ] Integration Tests
30+
- [ ] Tests do not apply
31+
- [ ] Needs testing (start an issue or do a follow up PR about it)
32+
33+
### Mentions
34+
<!-- Shout outs to your friends that you made this happen or need help. -->

.travis.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
sudo: required
2+
dist: xenial
3+
language: python
4+
5+
python: 3.6
6+
install: true
7+
8+
git:
9+
depth: false
10+
quiet: true
11+
12+
services: docker
13+
14+
stages:
15+
- name: tests
16+
if: type IN (push, pull_request)
17+
- name: uitests
18+
if: type IN (pull_request)
19+
20+
jobs:
21+
include:
22+
- stage: tests
23+
name: "Code Style Check"
24+
python: 3.6
25+
before_script:
26+
- pip install tox-travis
27+
script: tox -e flake8
28+
- stage: tests
29+
name: "Unit Tests"
30+
python: 3.6
31+
before_script:
32+
- pip install tox-travis
33+
script: tox -e pytest
34+
- stage: tests
35+
name: "Documentation Tests"
36+
python: 3.6
37+
before_script:
38+
- pip install tox-travis
39+
- wget https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz
40+
- tar -xvzf geckodriver-v0.24.0-linux64.tar.gz
41+
- rm geckodriver-v0.24.0-linux64.tar.gz
42+
- chmod +x geckodriver
43+
- sudo cp geckodriver /usr/local/bin/
44+
- geckodriver --version
45+
- sudo apt-get update
46+
- sudo apt-get install firefox -y
47+
script:
48+
- tox -e docs
49+
- stage: tests
50+
name: "Python Code Security Tests"
51+
python: 3.6
52+
before_script:
53+
- pip install tox-travis
54+
script: tox -e bandit
55+
- stage: uitests
56+
name: "Firefox UI Tests"
57+
python: 3.6
58+
before_script:
59+
- pip install tox-travis
60+
- wget https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz
61+
- tar -xvzf geckodriver-v0.24.0-linux64.tar.gz
62+
- rm geckodriver-v0.24.0-linux64.tar.gz
63+
- chmod +x geckodriver
64+
- sudo cp geckodriver /usr/local/bin/
65+
- geckodriver --version
66+
- sudo apt-get update
67+
- sudo apt-get install firefox -y
68+
script:
69+
- tox -e firefox
70+
- stage: uitests
71+
name: "Chrome UI Tests"
72+
python: 3.6
73+
before_script:
74+
- pip install tox-travis
75+
- curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add
76+
- echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee -a /etc/apt/sources.list.d/google-chrome.list
77+
- sudo apt-get -y update
78+
- sudo apt-get -y install google-chrome-stable
79+
- wget https://chromedriver.storage.googleapis.com/76.0.3809.68/chromedriver_linux64.zip
80+
- unzip chromedriver_linux64.zip
81+
- rm chromedriver_linux64.zip
82+
- chmod +x chromedriver
83+
- sudo cp chromedriver /usr/local/bin/
84+
- sudo chromedriver --version
85+
script:
86+
- tox -e chrome
87+
88+
89+
notifications:
90+
email: false

CONTRIBUTING.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@ If you're reading this, it means you saw something that is not right, you want t
44

55
### Testing
66

7-
We have unit tests and currently no integration tests, and always in need of more. In our Git workflow unit tests are run on every Push and Merge Request.
7+
We have a handful of unit tests and UI tests. In our Git workflow unit tests are run on every Push and Pull Request, while UI tests run on every Pull Request.
8+
9+
For more information this guide on [swift-browser-ui testing](https://swift-browser-ui.readthedocs.io/en/latest/testing.html) might be worth a read.
810

911
### Submitting Issues
1012

1113
We have templates for submitting new issues, that you can fill out. For example if you found a bug, use the Bug Report template
1214

1315
### Submitting changes
1416

15-
When you made some changes you are happy with please send a [GitLab merge Request to swift-browser-ui](https://gitlab.csc.fi/CSCCSDP/swift-browser-ui/merge_requests/new) with a clear list of what you've done (read more about [merge requests](https://docs.gitlab.com/ee/gitlab-basics/add-merge-request.html)). When you create that Merge Request, we will forever be in your debt if you check previous docs for typos.
17+
When you made some changes you are happy with please send a [GitLab merge Request to swift-browser-ui](https://github.com/CSCfi/swift-browser-ui/pull_requests/new/devel) with a clear list of what you've done (read more about [pull requests]https://help.github.com/en/articles/about-pull-requests)). When you create that Merge Request, we will forever be in your debt if you check previous docs for typos.
1618

1719
Please follow our Git branches model and coding conventions (both below), and make sure all of your commits are atomic (preferably one feature per commit) and it is recommended a Merge Request addresses one functionality or fixes one bug.
1820

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
## swift-browser-ui
22

3+
[![Build Status](https://travis-ci.org/CSCfi/swift-browser-ui.svg?branch=master)](https://travis-ci.org/CSCfi/swift-browser-ui)
4+
[![Coverage Status](https://coveralls.io/repos/github/CSCfi/swift-browser-ui/badge.svg?branch=maste)](https://coveralls.io/github/CSCfi/swift-browser-ui?branch=maste)
5+
[![Documentation Status](https://swift-browser-ui.readthedocs.io/en/latest/?badge=latest)](https://swift-browser-ui.readthedocs.io/en/latest/?badge=latest)
6+
37
### Description
48

59
A web frontend for browsing and downloading objects saved in [SWIFT](https://docs.openstack.org/swift/latest/)

tests/coveralls.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/env/python
2+
3+
import os
4+
from subprocess import call
5+
import sys
6+
7+
# Run converalls command only on Travis
8+
# Solution provided by
9+
# https://stackoverflow.com/questions/32757765/conditional-commands-in-tox-tox-travis-ci-and-coveralls
10+
11+
if __name__ == '__main__':
12+
if 'TRAVIS' in os.environ:
13+
rc = call('coveralls')
14+
sys.stdout.write("Coveralls report from TRAVIS CI.\n")
15+
# raise SystemExit(rc)
16+
else:
17+
sys.stdout.write("Not on TRAVIS CI.\n")

tox.ini

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ commands = python -m ui_tests.ui_take_screenshots
3131

3232
[testenv:pytest]
3333
basepython = python3.6
34+
passenv = TRAVIS TRAVIS_*
3435
deps =
3536
.[test]
3637
-rrequirements.txt
3738
commands = py.test -x --cov=swift_browser_ui tests/ --cov-fail-under=75
39+
python {toxinidir}/tests/coveralls.py
3840

3941
[testenv]
4042
basepython = python3.6
@@ -59,3 +61,8 @@ setenv =
5961
deps =
6062
.[ui_test]
6163
commands = py.test -vvv ui_tests/test_frontend_chrome.py ui_tests/test_session_chrome.py
64+
65+
[travis]
66+
unignore_outcomes = True
67+
python =
68+
3.6: py36

ui_tests/test_frontend_chrome.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from .common import wait_for_clickable
1717

1818

19-
class TestFirefoxFrontend(ChromiumTestClass):
19+
class TestChromeFrontend(ChromiumTestClass):
2020
"""Test the frontend wiht chrome."""
2121

2222
@pytest.mark.timeout(60)

0 commit comments

Comments
 (0)