Comments (8)
@harshil1712 okay, here's a mega response - I'd suggest working through these in order. Just the basic use case alone would be amazing.
testing library: how about jest? this will align with some other intermine-based tools.
use-cases:
basic
This won't require a testing library, probably just a travis yml file, possibly with a shell script as well. if the script completes = success, if it errors out partway = failure.
- does the setup scripting work correctly? (e.g. following the readme docs, set up a mongo, run the initregistry script and the createuser script).
advanced - unit tests
check directly against the mongo DB that:
- POST to /instances - does the POST get added to the DB correctly?
- POST to /instances - if a namespace already exists, does the api return an error? namespaces should be unique.
- GET to /instances - should return the correct number of results WHEN
- there are no params (should return all intermine instances)
- param: q=flymine
- param: mines=dev should not return any intermines with
"isProduction": true
- param: mines=prod should not return any intermines with
"isProduction": false
- param: mines=all should return a count of intermines that is sum of the total of dev and prod intermines.
- PUT to /instances should update the given instance, and only the given instance.
- PUT to /instances shouldn't allow a namespace to be changed
- DELETE to /instances should delete the given instance and only the given instance
Even more advanced - UI-based tests
ideally using cypress.
[TODO, ADD DETAILS AT SOME POINT] :)
from intermine-registry.
Hey @yochannah I would like to take this. I have very little experience with writing tests, but this seems the right opportunity to get started.
from intermine-registry.
It would be great if I could get some help. I have a few questions.
- Is there any preferred testing library that we should use?
- Can you please give examples of the use cases that require the test?
As I mentioned I am new with testing, and there might be a lot of questions coming from my end. 😅
from intermine-registry.
@harshil1712 that sounds amazing! Do you know where you'd plan to start or would you like to chat first?
from intermine-registry.
Hey @yochannah,
I've added the travis.yml file in my forked repo. But I am not sure how do I add checks for the setup scripts? To check that, won't we need a testing library?
basic
This won't require a testing library, probably just a travis yml file, possibly with a shell script as well. if the script completes = success, if it errors out partway = failure.
does the setup scripting work correctly? (e.g. following the readme docs, set up a mongo, run the initregistry script and the createuser script).
from intermine-registry.
@harshil1712 if you know a way to do this with a testing library, go ahead!
I was thinking something along the lines of a shell script - an example is here: https://github.com/intermine/bluegenes/blob/dev/.travis.yml#L30
from intermine-registry.
@yochannah thank you for the link. It helped me understand the approach better.
My .travis.yml
file contains the following line of code
language: node_js
node_js:
- "node"
services: mongodb
script:
# Install packages
- npm install
- export MONGODB_URL=mongodb://localhost:27017/registry
# Running createUser.js
- node createUser.js
# Populating the instance
- node initRegistry.js
# Start server
- npm start
This seems to work until the node createUser.js
is ran, since it asks for a username and a password, and since we cannot provide an input, the next step is not executed .
And we are using this username and password in the initRegister.js
file as well. Hence updating this file is also not possible with this approach, as per my understanding.
I am not sure if there's a way to do this apart from writing tests.
Please guide me for my next step.
from intermine-registry.
@yochannah I would like to work on this issue if it's still available. I haven't written any tests prior to this, so it will help me to learn more about writing tests.
from intermine-registry.
Related Issues (20)
- Fix the base URL in the docs
- Remove `/namespace` from the list of authorisation endpoints HOT 4
- Upgrade dependencies HOT 2
- new feature: return all intermines over version x HOT 3
- text change: update to include a link to add your mine to registry HOT 1
- og-expander: Didn't able to scroll if text overflow.
- og-expander: For long instance's title, there is overlapping. HOT 1
- Maintener GitHub Url field should be a list HOT 1
- The update instance page doesn't show maintener email and github url HOT 2
- [easy task if you know js] Update documentation to explain how to initialise the repo HOT 6
- Migration of ES5 variables to ES6 variables HOT 2
- DELETE /instances/{instancesId} endpoint throws an error even after removing the instance from the database HOT 3
- Update Mongoose API Methods currently used for Database Queries
- Query to update the list of mines more regularly? HOT 1
- Twitter Logo in Grid View HOT 6
- Make the header Sticky HOT 3
- Query by neighborhood HOT 2
- restrict overlarge logo sizes in mine popup
- Use anchor elements instead of span for mine links
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from intermine-registry.