Skip to content

Commit

Permalink
Merge branch 'master' into Issue-11245
Browse files Browse the repository at this point in the history
  • Loading branch information
rishisulakhe authored Mar 11, 2025
2 parents ad897a3 + bc92696 commit b3053b8
Show file tree
Hide file tree
Showing 398 changed files with 2,315 additions and 46,430 deletions.
540 changes: 269 additions & 271 deletions .circleci/config.yml

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions .github/workflows/jitpack-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
jobs:
trigger_build:
runs-on: ubuntu-latest
env:
ORG: cBioPortal
REPO: cbioportal-frontend
steps:
- name: Check out the code
uses: actions/checkout@v2
Expand All @@ -22,7 +25,7 @@ jobs:
- name: Trigger JitPack Build
run: |
TAG=${{ steps.get_tag.outputs.tag }}
JITPACK_BUILD_URL="https://jitpack.io/com/github/cbioportal/cbioportal-frontend/$TAG/build.log"
JITPACK_BUILD_URL="https://jitpack.io/com/github/$ORG/$REPO/$TAG/build.log"
MAX_RETRIES=10
RETRY_DELAY=30
Expand All @@ -47,7 +50,7 @@ jobs:
- name: Get POM File
run: |
TAG=${{ steps.get_tag.outputs.tag }}
JITPACK_POM_URL="https://jitpack.io/com/github/cbioportal/cbioportal-frontend/$TAG/cbioportal-frontend-$TAG.pom"
JITPACK_POM_URL="https://jitpack.io/com/github/$ORG/$REPO/$TAG/cbioportal-frontend-$TAG.pom"
MAX_RETRIES=60
RETRY_DELAY=30
Expand Down Expand Up @@ -93,4 +96,4 @@ jobs:
sed -i "s|<frontend.version>.*</frontend.version>|<frontend.version>$TAG</frontend.version>|" pom.xml
git add pom.xml
git commit -m "Frontend $TAG"
git push
git push
1 change: 0 additions & 1 deletion Procfile

This file was deleted.

67 changes: 8 additions & 59 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ A custom frontend can be tested against any backend in the web browser using a l
## Run of `localdb` e2e-tests
To enable e2e-tests on for features that depend on data that are not included in studies served by the public cBioPortal instance, cbioportal-frontend provides the `e2e local database` (refered to as _e2e-localdb_ or _local e2e_ in this text) facility that allows developers to load custom studies in any backend version used for e2e-tests. CircleCI runs the `e2e-localdb` tests as a separate job.

Files for the local database e2e-tests are located in the `./end-to-end-test/local` directory of cbioportal-frontend. The directory structure of `./end-to-end-test/local` is comparable to that of the `./end-to-end-test/remote` directory used for e2e-tests against remote public cBioPortal instances.
The script that can be used to run e2e-localdb tests is located at [./scripts/e2e.sh](./scripts/e2e.sh).

### Running `localdb` e2e-tests for development

Expand All @@ -195,67 +195,16 @@ Files for the local database e2e-tests are located in the `./end-to-end-test/loc

3. You need to have a global version of Maven installed.

In a terminal, start the frontend dev server

```
export BRANCH_ENV=custom
yarn install --frozen-lockfile // only necessary first time
yarn buildDLL:dev // only necessary first tiem
yarn start
```

3. Install dev dependencies:
```bash
cd end-to-end-test
yarn
```
5. In a second terminal at project root, spinup the backend (api) instance:

```
// if you are running for first time, you will need to build the docker containers.
// Answer yes when it prompts you to do so. This will take at least 20 minutes depending
// on your system speed.
// Once you have done this, you can answer no on subsequent attempts
In a terminal, run the following commands from root directory.
```shell
# Start backend and frontend servers
yarn run e2e:spinup
```

6. When backend instance is operational, you can run tests. Upon executing
the command below, a browser should open and you should see your tests execute.

# Run tests
yarn run e2e:local
```
//grep accepts fragments of file name,
//but you MUST using trailing *
//you need only match the file name, not path
yarn run e2e:local --grep=some.spec*
```



### Running e2e-localdb tests _CircleCI_ or _CircleCI+PR_ context
E2e-tests on _CircleCI_ and _CircleCI+PR_ context are triggered via _hooks_ configured on GitHub. Configuration of hooks falls beyond the scope of this manual.

#### cBioPortal-backend version
E2e-testing against a local database removes dependence on data provided by public cbioportal instances for testing. This makes it possible to test features for data types that are not provided by public cbioportal instances or test features that depend on a backend feature not yet integrated in public cbioportal instances. E2e-localdb tests make use of the `BACKEND` environmental variable to test against a specific backend version. Depending on the running context (see section above) setting the `BACKEND` environmental variable is required or optional (see table below).

Requirement for setting the BACKEND variable depends on the context of the job:

| **context** | **BACKEND var** | **comments** |
|------------------------ | ----------------- | ------------ |
| _Local_ | mandatory | |
| _CircleCI_ | mandatory for feature branches | not for `master` or `rc` builds |
| _CircleCI+PR_ | optional | 1. When specified, GitHub PR must be of 'draft' state.<br>2. When not-specified, backend branch will mirror frontend branch (rc frontend vs. rc backend) |

The value of the `BACKEND` variable must be formatted as `<BACKEND_GITHUB_USER>:<BACKEND_BRANCH>`. For example, when the /env/custom.sh file contains `export BACKEND=thehyve:uwe7872A` this is interpreted as a requirement for the commit `uwe7872A` of the _github.com/thehyve/cbioportal_ repository.

#### BACKEND environmental variable in _CircleCI+PR_ context
Using the `BACKEND` variable e2e-localdb tests can be conducted against any backend version. This poses a risk when testing in _CircleCI+PR_ context, i.e., tests show up as succesful but should have failed against the backend version that compatible with the target cbioportal-frontend branch. To guard against this and prevent merging of incompatible branches into cbioportal-frontend the e2e-localdb tests enforce the use of _draft_ pull requests (see [here](https://help.github.com/en/articles/creating-a-pull-request) for more info). When a cBioPortal backend version is specified (i.e., may require a not yet merged backend branch) and the branch is part of a pull request, the pull request must be in state _draft_. Only when the `BACKEND` variable is not defined a (non-_draft_) e2e-localdb tests will be conducted on branches that are part of pull requests. Needles to say, pull request should for this and other reasons only be merged when the e2e-localdb tests succeed!

When the `BACKEND` variable is not set, the backend version will be set to the target branch of the pull request, i.e. a pull request to 'rc' branch will be tested against the 'rc' branch of the backend.

#### Writing e2e tests
### Writing e2e tests
Some random remarks on e2e-test development
- Screenshot tests and DOM-based tests are contained in files that end with *.screenshot.spec.js or *.spec.js, respectively.
- Screenshot tests should only be used to test components that cannot be accessed via the DOM.
Expand All @@ -282,7 +231,7 @@ Making e2e-tests follows the current procedure for the e2e-tests:
* Gene panel and gene set matrix data of custom studies must comply with gene panel/sets imported as part of study_es_0.
* Imports of custom seed data for gene panels and gene sets are not implemented at the moment of this writing.
* In order to minimize time of local database e2e-tests the size of custom studies should be kept as small as possible.
* When developing in _Local_ context port 8081 can be used to access the cbioportal instance ('http://localhost:8081/cbioportal').
* When developing in _Local_ context port 8080 can be used to access the cbioportal instance ('http://localhost:8080').

#### Debugging help
Here are some errors that have been encountered and are hard to debug.
Expand Down
22 changes: 0 additions & 22 deletions app.json

This file was deleted.

Binary file added brand_assets/cBioPortalLogo2024.zip
Binary file not shown.
17 changes: 0 additions & 17 deletions end-to-end-test/local/docker_compose/build.sh

This file was deleted.

15 changes: 0 additions & 15 deletions end-to-end-test/local/docker_compose/cbioportal-custombranch.yml

This file was deleted.

20 changes: 0 additions & 20 deletions end-to-end-test/local/docker_compose/cbioportal.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
FROM circleci/node:15.2.1-browsers
MAINTAINER Pim van Nierop <pim@thehyve.nl>

LABEL Description="End-2-end test image for cBioPortal frontend"

#echo INSTALL cavas deps [necessary for visual regression framework]
#RUN apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev

USER root

CMD /cbioportal-frontend/end-to-end-test/local/docker_compose/docker/screenshottest.sh
5 changes: 0 additions & 5 deletions end-to-end-test/local/docker_compose/docker/screenshottest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,9 @@ set -e
set -u # unset variables throw error
set -o pipefail # pipes fail when partial command fails

#echo INSTALL SCREENSHOT DEPENDENCIES
#cd /cbioportal-frontend/end-to-end-test
#yarn install --frozen-lockfile

export FRONTEND_TEST_USE_LOCAL_DIST=false
export HEADLESS_CHROME=false

#echo START SERVE_DIST
cd /cbioportal-frontend
yarn serveDistLocalDb &

Expand Down
82 changes: 0 additions & 82 deletions end-to-end-test/local/docker_compose/initdb.sh

This file was deleted.

50 changes: 0 additions & 50 deletions end-to-end-test/local/docker_compose/keycloak.yml

This file was deleted.

Loading

0 comments on commit b3053b8

Please sign in to comment.