Skip to content

Commit

Permalink
Merge pull request #1183 from kbase/develop
Browse files Browse the repository at this point in the history
3.5.1 release
  • Loading branch information
briehl committed Oct 25, 2017
2 parents 09088d5 + 5f4983b commit 8de7fea
Show file tree
Hide file tree
Showing 43 changed files with 1,471 additions and 947 deletions.
3 changes: 3 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[run]
omit =
src/biokbase/narrative/tests/*
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ branches:
- travis-firefox

before_install:
- pip install virtualenv
- pip install virtualenv coveralls
- gem install coveralls-lcov
- nvm install $TRAVIS_NODE_VERSION
- npm install -g bower
- npm install -g grunt-cli
Expand All @@ -35,3 +36,7 @@ before_script:
- sleep 3 # give xvfb some time to start

script: make build-travis-narrative && make test

after_script:
- coveralls-lcov -v -n js-coverage/lcov/lcov.info > js-coverage.json
- coveralls --merge js-coverage.json
18 changes: 9 additions & 9 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,15 @@ module.exports = function(grunt) {
'karma': {
unit: {
configFile: 'test/unit/karma.conf.js',
reporters: ['progress', 'coverage'],
coverageReporter: {
dir: 'build/test-coverage/',
reporters: [
{
type: 'html', subdir: 'html'
}
]
}
// reporters: ['progress'], //, 'coverage'],
// coverageReporter: {
// dir: 'build/test-coverage/',
// reporters: [
// {
// type: 'html', subdir: 'html'
// }
// ]
// }
},
dev: {
// to do - add watch here
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ test: test-backend test-frontend-unit test-frontend-e2e
test-backend:
@echo "running backend tests"
sh $(BACKEND_TEST_SCRIPT)
# @echo "THIS IS A NO-OP UNTIL THE AUTH2 SWITCH"
@echo "done"

# test-frontend-unit should use karma and jasmine to test
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
| Branch | Status |
| :--- | :--- |
| master | [![Build Status](https://travis-ci.org/kbase/narrative.svg?branch=master)](https://travis-ci.org/kbase/narrative) [![Coverage Status](https://coveralls.io/repos/kbase/narrative/badge.svg?branch=master)](https://coveralls.io/r/kbase/narrative?branch=master) |
| staging | [![Build Status](https://travis-ci.org/kbase/narrative.svg?branch=staging)](https://travis-ci.org/kbase/narrative) [![Coverage Status](https://coveralls.io/repos/kbase/narrative/badge.svg?branch=staging)](https://coveralls.io/r/kbase/narrative?branch=staging) |
| develop | [![Build Status](https://travis-ci.org/kbase/narrative.svg?branch=develop)](https://travis-ci.org/kbase/narrative) [![Coverage Status](https://coveralls.io/repos/kbase/narrative/badge.svg?branch=develop)](https://coveralls.io/r/kbase/narrative?branch=develop)|

This is the repository for the KBase Narrative Interface.
Expand Down
26 changes: 26 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,32 @@
The Narrative Interface allows users to craft KBase Narratives using a combination of GUI-based commands, Python and R scripts, and graphical output elements.

This is built on the Jupyter Notebook v4.4.1 (more notes will follow).
### Version 3.5.2
- TASK-1089 - Import data slide out panel tracks what object is added to narrative. Add button turns into copy if objecct already exists. Add pop up when user copies and overrides exisiting object.
- TASK-1094 - Fix overlapping cells and buttons issue in Firefox
- TASK-1113/PUBLIC-148 - Import Panel scrolls if panel size is larger than screen size
- TASK-1088 - Data Pane maintains filters after refresh due to changes in narritve
- TASK-1114 - Add lock when editing name, that prevents data panel from refreshing with new data. Reliquenishes lock after 15 min if no activity.
- Style Fixes
- Fix bold font display inconsistencies between different browsers
- Move tooltip in datapanel from covering buttons to the top
- TASK-1158 - Standardize app and object cards in narrative and data panel


### Version 3.5.1
- TASK-1117 - Add importer for FBAModels to staging area
- TASK-1116 - Add PhenotypeSet importer to staging area
- TASK-1089 - Import data slide out panel tracks what object is added to narrative. "Add" button turns into "copy" if object already exists. Add pop up when user copies and overrides existing object.
- TASK-1094 - Fix overlapping cells and buttons issue in Firefox
- TASK-1113/PUBLIC-148 - Import Panel scrolls if panel size is larger than screen size
- TASK-1088 - Data Pane maintains filters after refresh due to changes in narrative
- Style Fixes
- Fix bold font display inconsistencies between different browsers
- Move tooltip in data panel from covering buttons to the top
- KBASE-4756 - Fix data type filtering in data panel slideout.
- PTV-225 - Fixes sorting by type in data panel
- PTV-535 - Fix RNA-seq viewer to properly handle multiple input types.
- PUBLIC-123 - Fix incorrect reaction counts in FBA Model viewer

### Version 3.5.0
- TASK-1054 - Create a new loading window with a set of tasks to load and connect to (treats the problem of slowly loading websockets, still probably needs some adjusting).
Expand Down
49 changes: 49 additions & 0 deletions docs/testing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Narrative Unit Testing

### Short version
1. Install the Narrative and activate its virtualenv (if appropriate)
a. (optional) set credentials in test/
2. Run `make test` at a prompt.
3. Lament the coverage is so low.

### Long version
**About**
Because the Narrative Interface is built on both the front and back ends of the Jupyter Notebook, there's two sides to Narrative testing. The front end tests are in JavaScript, and make use of [Karma](http://karma-runner.github.io/1.0/index.html) as a test runner, and [Jasmine](https://jasmine.github.io/2.0/introduction.html) as a testing language. The back end tests are written in Python using the unittest framework, and run with [nose](http://nose.readthedocs.io/en/latest/).

**How to run tests**
We aren't testing the underlying Jupyter code, but we are making use of it, so a test run requires a Narrative install as described in the [installation](../install/local_install.md) docs. If you're installing in a Virtualenv, make sure it's activated. You don't need to run the narrative yourself for tests to work, it just needs to be installed.

Then, simply run (from the narrative root directory) `make test`.

This calls a few subcommands, and those can be run independently for specific uses:
* `make test-frontend-unit` will run only the unit tests on the frontend (i.e. those with the Karma runner)
* `make test-frontend-e2e` will run only the frontend tests that make use of Selenium to simulate a browser on the real Narrative site.
* `make test-backend` will run only the backend Python tests.

**Add credentials for tests**
The Narrative Interface is one of the hubs of KBase - it touches several different services, all of which need real authentication. Some of those have been mocked in various tests (like running apps), but others (the Workspace service) still require a real Auth token. If you have a KBase Developer account, you can create a Developer Token in the Account tab of the main KBase interface.

You can store auth token files in test/. These are single line files, containing only the Auth token used for testing a single user. For example, `test/narrativetest.tok` would be for the narrativetest user, and would only contain that user's Auth token. DO NOT CHECK THESE IN TO GITHUB.

Next, these credentials need to be referenced for both the back and front end. This version requires two configs - one for Python, and one for JavaScript.

* Python:
`src/biokbase/narrative/tests/test.cfg`
In the `[users]` and `[token_files]` blocks, two sets of values are needed: test_user and private_user. They don't have any special permissions, they just need to be different users.

* JavaScript:
`test/unit/testConfig.json`
This just needs the path to the token file (with pre-pended slash), such as `"/test/narrativetest.tok"`

* *TODO (10/24/2017): Unify these token configs!*

**Testing with Travis-CI / Coveralls**
These tests are run (without credentials) automatically on a pull request to the Narrative Github repo. These are currently run through [Travis-CI](https://travis-ci.org/) and the coverage reported with [Coveralls](https://coveralls.io/). There should be nothing you need to do to make this work.

**Adding your own tests**
* **Python**
Python tests should be per module, and should all be added to the `src/biokbase/narrative/tests`. The `test.cfg` file there is in INI file format, and should be added to, as necessary.

There are some service client Mocks available using the `mock` library. Check out `test_appmanager.py` for some examples of how these can be used.
* **JavaScript**
JavaScript tests follow the common Test Spec idiom. Here, we create a new spec file for each JavaScript module. These all live under `test/unit/spec` in roughly the same subdirectory as found under `kbase-extension/static/kbase/js`. There's an example spec in `test/unit/specTemplate.js` - you can just copy this to a new module, and modify to fit your needs.
6 changes: 5 additions & 1 deletion kbase-extension/static/custom/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,11 @@ span#notebook_name:hover {
right: 0;
bottom: 0;
overflow: auto;
padding-bottom: 100px;
}
#notebook-container:after{
content: "";
height: 100px;
display:block;
}


Expand Down
26 changes: 26 additions & 0 deletions kbase-extension/static/kbase/config/staging_upload.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,17 @@
"id": "media",
"name": "Media"
},
{
"id": "fba_model",
"name": "FBA Model"
},
{
"id": "assembly",
"name": "Assembly"
},
{
"id": "phenotype_set",
"name": "Phenotype Set"
}
],
"app_info": {
Expand Down Expand Up @@ -84,6 +92,15 @@
"app_output_suffix": "_media",
"multiselect": false
},
"fba_model": {
"app_id": "kb_uploadmethods/import_file_as_fba_model_from_staging",
"app_input_param": "model_file",
"app_input_param_type": "string",
"app_static_params": {},
"app_output_param": "model_name",
"app_output_suffix": "_model",
"multiselect": false
},
"assembly": {
"app_id": "kb_uploadmethods/import_fasta_as_assembly_from_staging",
"app_input_param": "staging_file_subdir_path",
Expand All @@ -92,6 +109,15 @@
"app_output_param": "assembly_name",
"app_output_suffix": "_assembly",
"multiselect": false
},
"phenotype_set": {
"app_id": "kb_uploadmethods/import_tsv_as_phenotype_set_from_staging",
"app_input_param": "staging_file_subdir_path",
"app_input_param_type": "string",
"app_static_params": {},
"app_output_param": "phenotype_set_name",
"app_output_suffix": "_phenotype_set",
"multiselect": false
}
}
}

0 comments on commit 8de7fea

Please sign in to comment.