@@ -43,7 +43,7 @@ To build the assets, rebuild on file change, and serve them by Grafana's webserv
43
43
``` bash
44
44
npm install -g yarn
45
45
yarn install --pure-lockfile
46
- npm run watch
46
+ yarn run watch
47
47
```
48
48
49
49
Build the assets, rebuild on file change with Hot Module Replacement (HMR), and serve them by webpack-dev-server (http://localhost:3333 ):
@@ -54,14 +54,14 @@ env GRAFANA_THEME=light yarn start
54
54
```
55
55
Note: HMR for Angular is not supported. If you edit files in the Angular part of the app, the whole page will reload.
56
56
57
- Run tests
57
+ Run tests
58
58
``` bash
59
- npm run jest
59
+ yarn run jest
60
60
```
61
61
62
62
Run karma tests
63
63
``` bash
64
- npm run karma
64
+ yarn run karma
65
65
```
66
66
67
67
### Recompile backend on source change
@@ -98,30 +98,42 @@ In your custom.ini uncomment (remove the leading `;`) sign. And set `app_mode =
98
98
#### Frontend
99
99
Execute all frontend tests
100
100
``` bash
101
- npm run test
101
+ yarn run test
102
102
```
103
103
104
104
Writing & watching frontend tests (we have two test runners)
105
105
106
106
- jest for all new tests that do not require browser context (React+more)
107
- - Start watcher: ` npm run jest`
107
+ - Start watcher: ` yarn run jest`
108
108
- Jest will run all test files that end with the name ".jest.ts"
109
109
- karma + mocha is used for testing angularjs components. We do want to migrate these test to jest over time (if possible).
110
- - Start watcher: ` npm run karma`
110
+ - Start watcher: ` yarn run karma`
111
111
- Karma+Mocha runs all files that end with the name "_ specs.ts".
112
112
113
113
#### Backend
114
114
``` bash
115
115
# Run Golang tests using sqlite3 as database (default)
116
- go test ./pkg/...
116
+ go test ./pkg/...
117
117
118
118
# Run Golang tests using mysql as database - convenient to use /docker/blocks/mysql_tests
119
- GRAFANA_TEST_DB=mysql go test ./pkg/...
119
+ GRAFANA_TEST_DB=mysql go test ./pkg/...
120
120
121
121
# Run Golang tests using postgres as database - convenient to use /docker/blocks/postgres_tests
122
- GRAFANA_TEST_DB=postgres go test ./pkg/...
122
+ GRAFANA_TEST_DB=postgres go test ./pkg/...
123
123
```
124
124
125
+ ## Building custom docker image
126
+
127
+ You can build a custom image using Docker, which doesn't require installing any dependencies besides docker itself.
128
+ ``` bash
129
+ git clone https://github.com/grafana/grafana
130
+ cd grafana
131
+ docker build -t grafana:dev .
132
+ docker run -d --name=grafana -p 3000:3000 grafana:dev
133
+ ```
134
+
135
+ Open grafana in your browser (default: ` http://localhost:3000 ` ) and login with admin user (default: ` user/pass = admin/admin ` ).
136
+
125
137
## Contribute
126
138
127
139
If you have any idea for an improvement or found a bug, do not hesitate to open an issue.
0 commit comments