Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
imedina committed Sep 10, 2020
2 parents 87b67c4 + 9b56066 commit 74d2cfa
Show file tree
Hide file tree
Showing 87 changed files with 27,511 additions and 2,846 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@

build
dist
bower_components
node_modules
web_modules
private
web_modules

# General
*.jar
Expand Down
25 changes: 21 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
pipeline {
agent any
stages {
stage ('Build source code') {
stage ('Build source code') {
options {
timeout(time: 5, unit: 'MINUTES')
}
steps {
sh 'npm install --unsafe-perm && npm run build'
}
}
stage ('Docker Build and Push') {
stage ('Build and Push Stable Docker') {
options {
timeout(time: 25, unit: 'MINUTES')
}
Expand All @@ -18,14 +18,31 @@ pipeline {
}
steps {
script {
def tag = sh(returnStdout: true, script: "git tag --sort version:refname | tail -1").trim()
def tag = sh(returnStdout: true, script: "node -p \"require('./package.json').version\"").trim()
sh "docker build -t opencb/iva:'${tag}' -f docker/Dockerfile ."
withDockerRegistry([ credentialsId: "wasim-docker-hub", url: "" ]) {
sh "docker push opencb/iva:'${tag}'"
}
}
}
}
}
stage ('Build and Push Development Docker') {
options {
timeout(time: 25, unit: 'MINUTES')
}
when {
branch "develop"
}
steps {
script {
def tag = sh(returnStdout: true, script: "node -p \"require('./package.json').version\"").trim()
sh "docker build -t opencb/iva:'${tag}' -f docker/Dockerfile ."
withDockerRegistry([ credentialsId: "wasim-docker-hub", url: "" ]) {
sh "docker push opencb/iva:'${tag}'"
}
}
}
}
}
}

29 changes: 29 additions & 0 deletions bs-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const path = require("path");

/*
|--------------------------------------------------------------------------
| IVA Browser-sync config file
|--------------------------------------------------------------------------
*/
module.exports = {
files: [
"src",
"lib/jsorolla/src",
"lib/jsorolla/styles"
],
server: {
//baseDir: path.resolve(__dirname),
//directory: true
},
startPath: "src",
open: true,
timestamps: true,
excludedFileTypes: [],
notify: {
styles: {
top: 'auto',
bottom: '0'
}
}

};
10 changes: 10 additions & 0 deletions credentials.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

echo -n "Enter your Opencga Username [ENTER]: "
read username
stty -echo
printf "Enter your Opencga password [ENTER]: "
read password
stty echo

CYPRESS_username=$username CYPRESS_password=$password "$@"
6 changes: 6 additions & 0 deletions cypress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"baseUrl": "http://localhost:3000/src/",
"chromeWebSecurity": false,
"viewportWidth": 1600,
"viewportHeight": 660
}
31 changes: 31 additions & 0 deletions cypress/integration/login.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
context("Login", () => {
beforeEach(() => {
cy.visit("http://localhost:3000/src/#login")
})

it("login unsuccessful", () => {
cy.get("#opencgaUser").type("demo")
cy.get("#opencgaPassword").type("demo")
cy.get("form#formLogin").submit()

cy.get("#error").contains( "Incorrect user or password.")
})

it("login uccessful", () => {

const username = Cypress.env("username")
const password = Cypress.env("password")

//console.log("username", username)
//console.log("password", password)

expect(username, "username was set").to.be.a("string").and.not.be.empty
expect(password, "password was set").to.be.a("string").and.not.be.empty
cy.get("#opencgaUser").type(username)
cy.get("#opencgaPassword").type(password)
cy.get("form#formLogin").submit()

cy.url().should("include", "#home")
cy.get(".subtitle").contains( "Interactive Variant Analysis")
})
})
34 changes: 34 additions & 0 deletions cypress/integration/opencga-clinical-portal.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import {login} from "../plugins/utils.js";
import "cypress-wait-until";

context("Case Portal", () => {
before(() => {
login();
})

it("query", () => {
/*cy.waitUntil(() => cy.getCookie("iva_sid").then(cookie => {
console.log("cookie", cookie)
return Boolean(cookie && cookie.value)
}));*/

cy.get("a[data-id=clinicalAnalysisPortal]").click({force: true})

//long timeout to make sure you are logged in
cy.get("div.page-title h2", {timeout: 60000}).should("be.visible").and("contain", "Case Portal")

//cy.get(".lhs button").should("have.length", 2)
cy.get(".clearfix > .pull-left > .pagination-info", {timeout: 10000})
.should("be.visible")
//.should('contain', /Showing \d+ to \d+ of \d+ records/)
//.and("contain", "Showing 1 to 10 of 18 records")


cy.get("opencga-clinical-analysis-grid .success > :nth-child(1)").then(elem => {
// elem is the underlying Javascript object targeted by the .get() command.
const firstCase = Cypress.$(elem).text().trim();
//opencga-clinical-analysis-view > data-form div:nth-child(1) > div.col-md-9
});

})
})
34 changes: 34 additions & 0 deletions cypress/integration/opencga-file-browser.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import {login} from "../plugins/utils.js";

context("File Browser", () => {
before(() => {
login();
})

it("query", () => {
cy.get("a[data-id=files]").click({force: true})
cy.get("div.page-title h2", {timeout: 60000}).should("be.visible").and("contain", "File Browser")

cy.get("#format + .subsection-content a").contains( "VCF").click({force: true})
cy.get("#bioformat + .subsection-content a").contains( "VARIANT").click({force: true})

cy.get(".lhs button[data-filter-name]").should("have.length", 2)

//cy.get('.fixed-table-toolbar').find(".pagination-info", {log:true})
cy.get("div.search-button-wrapper button").click()
})

it("aggregated query", () => {
cy.get("a[data-id=files]").click({force: true})
cy.get("a[href='#facet_tab']").click({force: true})
//cy.get("div.search-button-wrapper button").click()

//cy.wait(2000);

cy.get("#bs-select-4-2").click({force: true}) // creation year field
cy.get(`a[data-collapse="#creationYear_nested"]`).click({force: true}) // creation y field
cy.get("#bs-select-7-3").click({force: true}) // creation month nested in year field
cy.get("div.search-button-wrapper button").click()

})
})
39 changes: 39 additions & 0 deletions cypress/integration/opencga-individual-browser.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import {login} from "../plugins/utils.js";

context("Individual Browser", () => {
before(() => {
login();
})

it("query", () => {
cy.get("a[data-id=individuals]").click({force: true})
cy.get("div.page-title h2", {timeout: 60000}).should("be.visible").and("contain", "Individual Browser")

cy.get("#sex + .subsection-content a").contains( "MALE").click({force: true})
cy.get("#sex + .subsection-content a").contains( "FEMALE").click({force: true})

cy.get("#date + .subsection-content input[data-tab=recent] + label").click(); //creationDate recent

cy.get(".lhs button[data-filter-name]").should("have.length", 2);
cy.get("div.search-button-wrapper button").click();

})

it("aggregated query", () => {
cy.get("a[data-id=individuals]").click({force: true})

cy.get("a[href='#facet_tab']").click({force: true})
cy.get("button.default-facets-button").click();

cy.get(".lhs button[data-filter-name]:nth-child(3)").click(); //remove creationDate

cy.get("button.default-facets-button").click();

//cy.get("div.search-button-wrapper button").click()

//cy.get(".facet-wrapper .button-list button").should("have.length", 4);

//cy.get("opencb-facet-results opencga-facet-result-view").should("have.length", 4);

})
})
34 changes: 34 additions & 0 deletions cypress/integration/opencga-sample-browser.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import {login} from "../plugins/utils.js";

context("File Browser", () => {
before(() => {
login();
})

it("query", () => {
cy.get("a[data-id=samples]").click({force: true})
cy.get("div.page-title h2", {timeout: 60000}).should("be.visible").and("contain", "Sample Browser")

cy.get("#somatic + .subsection-content label").contains( "True").click({force: true})

cy.get(".lhs button[data-filter-name]").should("have.length", 1);
cy.get("div.search-button-wrapper button").click();

cy.get(".lhs .somaticActiveFilter").click();
cy.get(".lhs button[data-filter-name]").should("have.length", 0);

})

it("aggregated query", () => {
cy.get("a[data-id=samples]").click({force: true})

cy.get("a[href='#facet_tab']").click({force: true})
cy.get("button.default-facets-button").click()
cy.get("div.search-button-wrapper button").click()

cy.get(".facet-wrapper .button-list button").should("have.length", 4);

cy.get("opencb-facet-results opencga-facet-result-view").should("have.length", 4);

})
})
31 changes: 31 additions & 0 deletions cypress/integration/opencga-variant-browser.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import {login} from "../plugins/utils.js";

context("Variant Browser", () => {
before(() => {
login();
})

it("query", () => {
cy.get("a[data-id=browser]").click({force: true})
cy.get("div.page-title h2", {timeout: 60000}).should("be.visible").and("contain", "Variant Browser")


cy.get("input#lof").click({force: true});
cy.get("opencga-active-filters").contains("Consequence Types 10")
cy.get("button.ctActiveFilter").click()
})

it("aggregated query", () => {
cy.get("a[data-id=browser]").click({force: true})
cy.get("a[href='#facet_tab']").click({force: true})
cy.get("button.default-facets-button").click()
cy.get("div.search-button-wrapper button").click()

cy.wait(2000);

cy.get("#bs-select-1-4").click({force: true}) // gene aggregation field
cy.get("#type_Select a").contains( "INSERTION").click({force: true})
cy.get("div.search-button-wrapper button").click()

})
})
Loading

0 comments on commit 74d2cfa

Please sign in to comment.