Skip to content

Commit

Permalink
Merge pull request #163 from tom-and-the-toothfairies/iteration-6
Browse files Browse the repository at this point in the history
Iteration 6
  • Loading branch information
houli authored Mar 26, 2017
2 parents 3a84879 + 1d7943f commit aadc2e8
Show file tree
Hide file tree
Showing 43 changed files with 1,046 additions and 129 deletions.
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Tom and the Toothfairies
[![spacemacs badge]][spacemacs github] [![build status badge]][circle ci]

*Note: this document is written Markdown. While it can be easily read in a text
editor, we recommend viewing our documentation on
Github [here](https://github.com/tom-and-the-toothfairies/pathways#readme) for
maximum conveniece - the ability to click links for example.*
*Note: this document is written in Markdown. While it can be easily read in a
text editor, we recommend viewing our documentation [on
Github](https://github.com/tom-and-the-toothfairies/pathways#readme) for
maximum convenience - click-able links for example*

This file contains instructions on how to install and run the project, as well
as an overview of the project's design. The target platform is Ubuntu 16.04.

At the time of writing the current release is `1.1`
At the time of writing the current release is `1.2`

## Installing Dependencies

Expand Down Expand Up @@ -48,7 +48,15 @@ $ sudo docker-compose down

## Features

The feature list for the project can be found [here](./doc/FEATURES.md)
### Release 2

The feature list for `Release 2` can be found [in the Release 2 features
document](./doc/FEATURES_RELEASE_2.md).

### Release 1

The feature list for `Release 1` can be found [in the Release 1 features
document](./doc/FEATURES_RELEASE_1.md).

## Change Log

Expand Down
2 changes: 1 addition & 1 deletion athloi/Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
source 'https://rubygems.org'
ruby '2.4.0'
ruby '~> 2.4.0'

group :test do
gem 'capybara'
Expand Down
17 changes: 17 additions & 0 deletions athloi/features/file_upload.feature
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,23 @@ Feature: File upload
Then I should see the error panel
And the error panel title should be "Syntax error"

Scenario: uploading a PML file with unnamed constructs
When I select "analysis/unnamed.pml"
And I submit the upload form
Then I should see the unnamed panel
And I should see the following warnings in the unnamed panel:
| task on line 2 |

Scenario: uploading a PML file with clashing construct names
When I select "analysis/clashes.pml"
And I submit the upload form
Then I should see the clashes panel
And I should see the following warnings in the clashes panel:
| action clash1 on line 2 |
| action clash1 on line 8 |
| action clash2 on line 4 |
| action clash2 on line 6 |

Scenario: uploading a binary file
When I select "example.png"
And I submit the upload form
Expand Down
10 changes: 10 additions & 0 deletions athloi/features/fixtures/analysis/clashes.pml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
process foo {
action clash1 {
}
action clash2 {
}
action clash2 {
}
action clash1 {
}
}
File renamed without changes.
4 changes: 4 additions & 0 deletions athloi/features/fixtures/analysis/unnamed.pml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
process foo {
task {
}
}
28 changes: 28 additions & 0 deletions athloi/features/step_definitions/file_upload_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,31 @@

expect(ddis_element.text).to eq('I have not identified any interactions between the drugs in this file.')
end

Then(/^I should see the unnamed panel$/) do
panel = find('#unnamed-panel')

expect(panel).to be_visible
end

Then(/^I should see the following warnings in the unnamed panel:$/) do |unnameds|
body = find('#unnamed-text')

unnameds.raw.flatten.each do |unnamed|
expect(body).to have_content(unnamed)
end
end

Then(/^I should see the clashes panel$/) do
panel = find('#clashes-panel')

expect(panel).to be_visible
end

Then(/^I should see the following warnings in the clashes panel:$/) do |clashes|
body = find('#clashes-text')

clashes.raw.flatten.each do |clash|
expect(body).to have_content(clash)
end
end
2 changes: 1 addition & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ test:
override:
- docker run -t -e "MIX_ENV=test" -e "CI=true" -v $CIRCLE_TEST_REPORTS/exunit:/test-reports tomtoothfairies/panacea mix test
- docker run -t -v $CIRCLE_TEST_REPORTS/pytest:/test-reports tomtoothfairies/asclepius pytest --junitxml=/test-reports/test-junit-report.xml
- docker-compose -f docker-compose.e2e.yml -f docker-compose.e2e.ci.yml run athloi
- docker-compose -f docker-compose.e2e.dev.yml -f docker-compose.e2e.ci.yml run athloi

post:
- docker logs pathways_panacea_1 > $CIRCLE_ARTIFACTS/logs/panacea.log
Expand Down
22 changes: 21 additions & 1 deletion doc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
# Change Log

All notable changes to this project will be documented in this file.
## [1.2] 2017-03-26

### Added
- Added a features document for Release 2.
- Parser now reports unnamed PML constructs. These are then displayed to the
user in a similar manner to other warnings.
- Parser now reports PML construct name clashes. These are then displayed to the
user in a similar manner to other warnings.

### Changed
- Updated how warnings are displayed. Where possible, warnings now contain a
preview of the section of the PML file that caused the warning. This is
currently implemented for `Unnamed Constructs` and `PML Construct Name
Clashes`. We intend to use a similar design for other errors and warnings in
the future.

### Fixed
- Running automated integration tests will now correctly test the release
matching the current tag that is checked out.

## [1.1] 2017-03-19

Expand Down Expand Up @@ -120,7 +139,8 @@ All notable changes to this project will be documented in this file.
docker service: pathways.
- Installation instructions in README

[Unreleased]: https://github.com/tom-and-the-toothfairies/pathways/compare/1.1...iteration-6
[Unreleased]: https://github.com/tom-and-the-toothfairies/pathways/compare/1.2...iteration-7
[1.2]: https://github.com/tom-and-the-toothfairies/pathways/compare/1.1...1.2
[1.1]: https://github.com/tom-and-the-toothfairies/pathways/compare/1.0...1.1
[1.0]: https://github.com/tom-and-the-toothfairies/pathways/compare/0.3...1.0
[0.3]: https://github.com/tom-and-the-toothfairies/pathways/compare/0.2...0.3
Expand Down
14 changes: 1 addition & 13 deletions doc/FEATURES.md → doc/FEATURES_RELEASE_1.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Features

Each deliverable feature for the project is outlined in this file. Each feature
Each deliverable feature for Release 1 is outlined in this file. Each feature
is given a short description. For completed features, instructions on how to
verify the feature are provided.

Expand Down Expand Up @@ -230,18 +230,6 @@ http://chiron:3030/dinto/query`) and the contents of those queries.

See [On Screen DINTO Reporting](#on-screen-dinto-reporting---complete)

## PML-TX Save PML to File - Complete

### Description
The system should be able to allow saving of transformed PML files.

### Testing
Visit the [homepage] and select a valid PML file; for example
`panacea/text/fixtures/ddis.pml`. Press the `Submit` button. You should now see
a `Download PML TX File` button. Clicking the button, depending on your
browser, will either download the file automatically or prompt you to provide a
filename and location and download the file.

[README]: ../README.md
[homepage]: http://localhost:4000
[fixtures directory]: ../panacea/test/fixtures
Expand Down
75 changes: 75 additions & 0 deletions doc/FEATURES_RELEASE_2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Features

Each deliverable feature for Release 2 is outlined in this file. Each feature
is given a short description. For completed features, instructions on how to
verify the feature are provided.

Continuous integration testing has been set up for the project and can be
tracked [here](https://circleci.com/gh/tom-and-the-toothfairies/pathways).

## End to End Automated Testing

We have developed a suite of end to end tests that verify the whole system's
functionality by automating interactions with a web browser. These can be run
with the following command

```bash
$ sudo docker-compose -f docker-compose.e2e.yml -p integration run athloi; sudo docker-compose -f docker-compose.e2e.yml -p integration down
```

Our to end to end tests are written using the Cucumber
behaviour-driven-development test framework which allows tests to be written
according to user stories in plain English in the friendly "Given When Then"
format. These `feature` files can be found [here](../athloi/features).

## Manually Verifying Features

To manually verify features, run the project as outlined in the [README].
The homepage is available at [localhost:4000](http://localhost:4000).

## Report Unnamed PML Construct - Complete

### Description

The system must identify PML constructs that are not named. The system must
display useful error messages about such constructs to the user.

### Testing

Visit the [homepage] and select the file
`panacea/test/fixtures/analysis/unnamed.pml`. Press `Submit`. A warning should
now be visible outlining the `Unnamed PML Constructs` in the file.

Specifically, it should highlight an unnamed `task` on line `2`.

## Report PML Construct Name Clashes - Complete

### Description

The system must identify PML constructs that have the same name. The system
must display useful error messages about such constructs to the user.

### Testing

Visit the [homepage] and select the file
`panacea/test/fixtures/analysis/clashes.pml`. Press `Submit`. A warning should
now be visible outlining the `PML Construct Name Clashes` in the file.

Specifically, it should highlight name clashes for constructs named `clash1`
and `clash2`.

## PML-TX Save PML to File - Complete

### Description
The system must be able to allow saving of transformed PML files.

### Testing
Visit the [homepage] and select a valid PML file; for example
`panacea/text/fixtures/ddis.pml`. Press the `Submit` button. You should now see
a `Download PML TX File` button. Clicking the button, depending on your
browser, will either download the file automatically or prompt you to provide a
filename and location and download the file.

[README]: ../README.md
[homepage]: http://localhost:4000
[fixtures directory]: ../panacea/test/fixtures
24 changes: 24 additions & 0 deletions docker-compose.e2e.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: '2'

services:
asclepius:
image: tomtoothfairies/asclepius:latest
depends_on:
- chiron

panacea:
depends_on:
- asclepius
image: tomtoothfairies/panacea:latest

chiron:
image: tomtoothfairies/chiron:latest

selenium:
image: selenium/standalone-firefox:latest

athloi:
depends_on:
- selenium
- panacea
image: tomtoothfairies/athloi:latest
8 changes: 4 additions & 4 deletions docker-compose.e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ version: '2'

services:
asclepius:
image: tomtoothfairies/asclepius:latest
image: tomtoothfairies/asclepius:1.2
depends_on:
- chiron

panacea:
depends_on:
- asclepius
image: tomtoothfairies/panacea:latest
image: tomtoothfairies/panacea:1.2

chiron:
image: tomtoothfairies/chiron:latest
image: tomtoothfairies/chiron:1.2

selenium:
image: selenium/standalone-firefox:latest
Expand All @@ -21,4 +21,4 @@ services:
depends_on:
- selenium
- panacea
image: tomtoothfairies/athloi:latest
image: tomtoothfairies/athloi:1.2
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ services:
asclepius:
depends_on:
- chiron
image: tomtoothfairies/asclepius:1.1
image: tomtoothfairies/asclepius:1.2

panacea:
depends_on:
- asclepius
image: tomtoothfairies/panacea:1.1
image: tomtoothfairies/panacea:1.2
ports:
- '4000:4000'

chiron:
image: tomtoothfairies/chiron:1.1
image: tomtoothfairies/chiron:1.2
Loading

0 comments on commit aadc2e8

Please sign in to comment.