Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

#### Describe the bug
<!-- A clear and concise description of what the bug is. -->

#### To Reproduce
Steps to reproduce the behaviour:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

#### Expected behavior
<!-- A clear and concise description of what you expected to happen. -->

#### Screenshots
<!-- If applicable, add screenshots to help explain your problem. -->

#### Additional context
<!-- Add any other context about the problem here. -->
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

#### Proposed solution
<!-- A clear and concise description of what you want to happen. -->

#### DoD (Definition of Done)
<!-- How to know this is implemented. Preferably one short sentence. -->

#### Testing
<!-- How can someone else verify the task, can be test-suite or something else. -->
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/general-issue-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: General issue template
about: Describe this issue template's purpose here.
title: ''
labels: ''
assignees: ''

---

#### Description
<!-- A clear and concise description of what you want to happen. -->

#### DoD (Definition of Done)
<!-- How to know this is implemented. Preferably one short sentence. -->

#### Testing
<!-- How can someone else verify the task, can be test-suite or something else. -->
34 changes: 34 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
### Description

<!-- Please include a summary of the change or any information deemed important. -->

### Related issues
<!-- Reference any follow up issues with "Fixes #<issue-num>." -->

### Type of change

<!-- Replace [ ] with [x] to select options. -->
<!-- Please delete options that are not relevant. -->

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update (this needs a follow up PR)

### Changes Made

<!-- List changes made. -->

### Testing

<!-- Are any tests part of this PR. -->
<!-- Replace [ ] with [x] to select options. -->
<!-- Please delete options that are not relevant. -->

- [ ] Unit Tests
- [ ] Integration Tests
- [ ] Tests do not apply
- [ ] Needs testing (start an issue or do a follow up PR about it)

### Mentions
<!-- Shout outs to your friends that you made this happen or need help. -->
90 changes: 90 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
sudo: required
dist: xenial
language: python

python: 3.6
install: true

git:
depth: false
quiet: true

services: docker

stages:
- name: tests
if: type IN (push, pull_request)
- name: uitests
if: type IN (pull_request)

jobs:
include:
- stage: tests
name: "Code Style Check"
python: 3.6
before_script:
- pip install tox-travis
script: tox -e flake8
- stage: tests
name: "Unit Tests"
python: 3.6
before_script:
- pip install tox-travis
script: tox -e pytest
- stage: tests
name: "Documentation Tests"
python: 3.6
before_script:
- pip install tox-travis
- wget https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz
- tar -xvzf geckodriver-v0.24.0-linux64.tar.gz
- rm geckodriver-v0.24.0-linux64.tar.gz
- chmod +x geckodriver
- sudo cp geckodriver /usr/local/bin/
- geckodriver --version
- sudo apt-get update
- sudo apt-get install firefox -y
script:
- tox -e docs
- stage: tests
name: "Python Code Security Tests"
python: 3.6
before_script:
- pip install tox-travis
script: tox -e bandit
- stage: uitests
name: "Firefox UI Tests"
python: 3.6
before_script:
- pip install tox-travis
- wget https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz
- tar -xvzf geckodriver-v0.24.0-linux64.tar.gz
- rm geckodriver-v0.24.0-linux64.tar.gz
- chmod +x geckodriver
- sudo cp geckodriver /usr/local/bin/
- geckodriver --version
- sudo apt-get update
- sudo apt-get install firefox -y
script:
- tox -e firefox
- stage: uitests
name: "Chrome UI Tests"
python: 3.6
before_script:
- pip install tox-travis
- curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add
- echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee -a /etc/apt/sources.list.d/google-chrome.list
- sudo apt-get -y update
- sudo apt-get -y install google-chrome-stable
- wget https://chromedriver.storage.googleapis.com/76.0.3809.68/chromedriver_linux64.zip
- unzip chromedriver_linux64.zip
- rm chromedriver_linux64.zip
- chmod +x chromedriver
- sudo cp chromedriver /usr/local/bin/
- sudo chromedriver --version
script:
- tox -e chrome


notifications:
email: false
6 changes: 4 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@ If you're reading this, it means you saw something that is not right, you want t

### Testing

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.
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.

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.

### Submitting Issues

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

### Submitting changes

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.
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.

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.

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## swift-browser-ui

[![Build Status](https://travis-ci.org/CSCfi/swift-browser-ui.svg?branch=master)](https://travis-ci.org/CSCfi/swift-browser-ui)
[![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)
[![Documentation Status](https://swift-browser-ui.readthedocs.io/en/latest/?badge=latest)](https://swift-browser-ui.readthedocs.io/en/latest/?badge=latest)

### Description

A web frontend for browsing and downloading objects saved in [SWIFT](https://docs.openstack.org/swift/latest/)
Expand Down
17 changes: 17 additions & 0 deletions tests/coveralls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/env/python

import os
from subprocess import call
import sys

# Run converalls command only on Travis
# Solution provided by
# https://stackoverflow.com/questions/32757765/conditional-commands-in-tox-tox-travis-ci-and-coveralls

if __name__ == '__main__':
if 'TRAVIS' in os.environ:
rc = call('coveralls')
sys.stdout.write("Coveralls report from TRAVIS CI.\n")
# raise SystemExit(rc)
else:
sys.stdout.write("Not on TRAVIS CI.\n")
7 changes: 7 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ commands = python -m ui_tests.ui_take_screenshots

[testenv:pytest]
basepython = python3.6
passenv = TRAVIS TRAVIS_*
deps =
.[test]
-rrequirements.txt
commands = py.test -x --cov=swift_browser_ui tests/ --cov-fail-under=75
python {toxinidir}/tests/coveralls.py

[testenv]
basepython = python3.6
Expand All @@ -59,3 +61,8 @@ setenv =
deps =
.[ui_test]
commands = py.test -vvv ui_tests/test_frontend_chrome.py ui_tests/test_session_chrome.py

[travis]
unignore_outcomes = True
python =
3.6: py36
2 changes: 1 addition & 1 deletion ui_tests/test_frontend_chrome.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from .common import wait_for_clickable


class TestFirefoxFrontend(ChromiumTestClass):
class TestChromeFrontend(ChromiumTestClass):
"""Test the frontend wiht chrome."""

@pytest.mark.timeout(60)
Expand Down