Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSL setup updates - readme and gitignore for Visual Studio #4945

Merged
merged 4 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,4 @@ e2e-localdb-workspace/
junit.xml
.nvim.lua
.luarc.json
.vs/
30 changes: 27 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ Note: you can check the frontend version of the live instance by checking `windo
Make sure you have installed the node version and yarn version specified in
[package.json](https://github.com/cBioPortal/cbioportal-frontend/blob/master/package.json).

> **Tip:** We recommend that you use [nvm: Node Version Manager](https://github.com/nvm-sh/nvm) and [yvm: Yarn Version Manager](https://yvm.js.org/docs/overview) to switch between versions more easily.
> **Tip:** For node, we recommend that you use [nvm: Node Version Manager](https://github.com/nvm-sh/nvm) to switch between versions easily.

> **Tip:** For yarn, you can use [yarn set version](https://yarnpkg.com/cli/set/version) or `npm install yarn@(version)`.

> **Windows Tip:** If you are developing on Windows, we recommend that you use [Ubuntu / Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10).

Expand Down Expand Up @@ -52,6 +54,8 @@ export BRANCH_ENV=master # or rc if branching from rc
yarn run start
```

> **Tip:** BRANCH_ENV should be set to `master` or `rc`, and not to your local branch name. You can set this in your ~/.bashrc if you don't intend to change it often.

Example pages:
- http://localhost:3000/
- http://localhost:3000/patient?studyId=lgg_ucsf_2014&caseId=P04
Expand All @@ -71,8 +75,6 @@ GREP=example.spec.js yarn run testModules

```

> **Windows Tip:** There is a known solved hiccup running the tests on Ubuntu via Windows Subsystem for Linux (WSL): [#7096](https://github.com/cBioPortal/cbioportal/issues/7096)

To run unit/integration tests in watch mode
```
yarn run test:watch
Expand Down Expand Up @@ -139,6 +141,12 @@ or clear entire local storage
```
localStorage.clear()
```
You can also add a bookmarklet to quickly switch to your local frontend server. Set the URL to the following:

```
javascript:(function()%7BlocalStorage.setItem%28%60localdev%60,true%29%3Bwindow.location.reload()%3B %7D)()
```

You can also use a netlify deployed cbioportal-frontend pull request for serving the JS:
1. Create the following bookmarklet:
```
Expand All @@ -147,6 +155,8 @@ javascript:(function()%7Bvar pr %3D prompt("Please enter PR%23")%3Bif (pr %26%26
2. Navigate to the cBioPortal installation that you want to test.
3. Click the bookmarklet and enter your pull request number.



## Run e2e-tests

End-to-end tests can be run against public cbioportal instances or against a local dockerized backend. These two e2e-tests types are referred to as `remote` and `local` types of e2e-tests.
Expand All @@ -161,6 +171,7 @@ cd end-to-end-test
// install deps
yarn --ignore-engines

cd ..
```

```
Expand Down Expand Up @@ -349,3 +360,16 @@ Please make sure to not introduce any dependencies from `cbioportal-frontend` wo
### react-mutation-mapper

[react-mutation-mapper](https://www.npmjs.com/package/react-mutation-mapper/) is a separate public npm library that contains the Mutation Mapper and related components.

## WSL Tips

When running on a Windows environment, use [WSL: Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10). You will be able to run a linux shell, which is necessary for many of the scripts used. You will also be able to use it concurrently with Windows applications.

Make sure the git repo is cloned under the WSL file system (under your home directory). If you instead clone it to the Windows file system (e.g. `/mnt/c/...` from WSL), then all scripts will be extremely slow.

If you may be working with the git repo via the Windows system, then make sure your line returns are set to `lf` as opposed to the Windows default `crlf`.

```
# from the repo folder
git config core.autocrlf false
```