You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Split integration test out
* Add e2e test
* Add E2E test workflow
* Fix profile for e2e tests
* update to run integration and e2e test
* Fix env vars
* fix sonar workflow
@@ -6,39 +6,47 @@ The cBioPortal for Cancer Genomics provides visualization, analysis, and downloa
6
6
7
7
If you would like to know how to setup a private instance of the portal and/or get set up for developing, see the [documentation](https://docs.cbioportal.org). For details on contributing code changes via pull requests, see our [Contributing document](CONTRIBUTING.md).
8
8
9
-
If you are interested in coordinating the development of new features, please contact [email protected] or reach out on https://slack.cbioportal.org.
9
+
If you are interested in coordinating the development of new features, please contact <[email protected]> or reach out on <https://slack.cbioportal.org>.
10
10
11
11
## 📘 Documentation
12
+
12
13
See [https://docs.cbioportal.org](https://docs.cbioportal.org)
13
14
14
15
## 🤝 License
16
+
15
17
See [LICENSE](./LICENSE)
16
18
17
19
## 💻 Run Backend
20
+
18
21
cBioPortal consists of several components, please read the [Architecture docs](https://docs.cbioportal.org/architecture-overview/) to figure out what repo would be relevant to edit. If you e.g. only want to make frontend changes, one can directly edit [the frontend repo](https://github.com/cbioportal/cbioportal-frontend) instead. Read the instructions in that repo for more info on how to do frontend development. This repo only contains the backend part. Before editing the backend, it's good to read the [backend code organization](docs/development/Backend-Code-Organization.md).
19
22
20
23
### Local Development
21
24
22
25
This section provides a summary. For Quick Start instructions, or for more additional information, please see [Deploy with Docker](https://docs.cbioportal.org/deployment/docker/)
23
26
24
27
#### What MySQL database to use
25
-
We recommend to set up a MySQL database automatically using [Docker Compose](https://github.com/cBioPortal/cbioportal-docker-compose). It's useful to know how to do this as it allows you to import any dataset of your choice. For debugging production issues, we also have a database available with all the data on https://cbioportal.org that one can connect to directly. Please reach out on slack to get the credentials.
28
+
29
+
We recommend to set up a MySQL database automatically using [Docker Compose](https://github.com/cBioPortal/cbioportal-docker-compose). It's useful to know how to do this as it allows you to import any dataset of your choice. For debugging production issues, we also have a database available with all the data on <https://cbioportal.org> that one can connect to directly. Please reach out on slack to get the credentials.
26
30
27
31
#### Deploy your development image inside Docker Compose
28
-
The easiest option is to deploy your development image directly into the [docker-compose](https://github.com/cBioPortal/cbioportal-docker-compose/blob/5da068f0eb9b4f42db52ab5e91321b26a1826d7a/docker-compose.yml#L6) file.
32
+
33
+
The easiest option is to deploy your development image directly into the [docker-compose](https://github.com/cBioPortal/cbioportal-docker-compose/blob/5da068f0eb9b4f42db52ab5e91321b26a1826d7a/docker-compose.yml#L6) file.
2. From the cbioportal-docker-compose repo, change the [env file](https://github.com/cBioPortal/cbioportal-docker-compose/blob/master/.env) to use your image (e.g. **cbioportal/cbioportal:my-dev-cbioportal-image**).
35
42
36
43
3. Run the containers.
44
+
37
45
```
38
46
docker compose up
39
47
```
40
48
41
-
4. The app will be visible at http://localhost:8080.
49
+
4. The app will be visible at <http://localhost:8080>.
42
50
43
51
For more information, please see [Deploy with Docker](https://docs.cbioportal.org/deployment/docker/#building-cbioportal).
44
52
@@ -49,6 +57,7 @@ If you want to instead run the cBioPortal web app from the command line please f
49
57
```
50
58
docker compose -f docker-compose.yml -f dev/open-ports.yml up
51
59
```
60
+
52
61
This should open the ports. Now we are ready to run the cBioPortal web app locally. You can compile the backend code with:
53
62
54
63
```
@@ -70,7 +79,7 @@ java -Xms2g -Xmx4g \
70
79
org.cbioportal.PortalApplication
71
80
```
72
81
73
-
The app should now show up at http://localhost:8080.
82
+
The app should now show up at <http://localhost:8080>.
74
83
75
84
### Dev Database
76
85
@@ -98,35 +107,150 @@ You can then use a JAVA IDE to connect to that port. E.g. in [VSCode](https://co
98
107
}
99
108
```
100
109
110
+
## ✅ Testing Overview
111
+
112
+
This project uses a layered testing strategy that separates **unit**, **integration**, and **end-to-end (E2E)** tests for better clarity and control.
113
+
114
+
---
115
+
116
+
### 🧪 Test Layers
117
+
118
+
| Layer | Purpose | Runs by Default? | Tools Used |
|**Integration**| Test Spring components (e.g. JPA, Repositories) using real databases | 🚫 No | Spring Boot, Failsafe |
122
+
|**E2E**| Test full HTTP endpoints via real HTTP calls | 🚫 No | Spring Boot, TestRestTemplate, MockMvc |
123
+
124
+
---
125
+
126
+
### 📁 Directory Structure
127
+
128
+
```
129
+
src/test/java/ → Unit tests (default)
130
+
src/integration/java/ → Integration tests (DB, Spring context)
131
+
src/e2e/java/ → E2E tests (REST API over HTTP)
132
+
```
133
+
134
+
---
135
+
136
+
## 🔧 Configuration via Environment Variables
137
+
138
+
All integration and E2E tests are **configured via environment variables** for test DBs. This avoids hardcoding credentials and allows flexible use in local dev or CI.
|| main branch | upcoming release branch | later release candidate branch |
104
226
| --- | --- | --- | --- |
105
227
| Branch name |[`master`](https://github.com/cBioPortal/cbioportal/tree/master)| -- |[`rc`](https://github.com/cBioPortal/cbioportal/tree/rc)|
106
228
| Description | All bug fixes and features not requiring database migrations go here. This code is either already in production or will be released this week | Next release that requires database migrations. Thorough manual product review often takes place for this branch before release | Later releases with features that require database migrations. This is useful to allow merging in new features without affecting the upcoming release. Could be seen as a development branch, but note that only high quality pull requests are merged. That is the feature should be pretty much ready for release after merge. |
107
-
| Live instance |https://www.cbioportal.org / https://master.cbioportal.org| -- |https://rc.cbioportal.org|
108
-
| Live instance version |https://www.cbioportal.org/api/info / https://master.cbioportal.org/api/info| -- |https://rc.cbioportal.org/api/info|
229
+
| Live instance |<https://www.cbioportal.org> / <https://master.cbioportal.org>| -- |<https://rc.cbioportal.org>|
230
+
| Live instance version |<https://www.cbioportal.org/api/info> / <https://master.cbioportal.org/api/info>| -- |<https://rc.cbioportal.org/api/info>|
0 commit comments