Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
qorus
grafana
Commits
c0254905
Commit
c0254905
authored
May 08, 2018
by
Dan Cech
Committed by
Leonard Gram
Aug 09, 2018
Browse files
move run script, update README
parent
96d6657b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Dockerfile
View file @
c0254905
...
...
@@ -69,7 +69,7 @@ COPY --from=1 /usr/src/app/tools ./tools
EXPOSE
3000
COPY
./docker/run.sh /run.sh
COPY
./
scripts/
docker/run.sh /run.sh
USER
grafana
ENTRYPOINT
[ "/run.sh" ]
README.md
View file @
c0254905
...
...
@@ -43,7 +43,7 @@ To build the assets, rebuild on file change, and serve them by Grafana's webserv
```
bash
npm
install
-g
yarn
yarn
install
--pure-lockfile
npm
run watch
yarn
run watch
```
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
```
Note: HMR for Angular is not supported. If you edit files in the Angular part of the app, the whole page will reload.
Run tests
Run tests
```
bash
npm
run jest
yarn
run jest
```
Run karma tests
```
bash
npm
run karma
yarn
run karma
```
### Recompile backend on source change
...
...
@@ -98,30 +98,42 @@ In your custom.ini uncomment (remove the leading `;`) sign. And set `app_mode =
#### Frontend
Execute all frontend tests
```
bash
npm
run
test
yarn
run
test
```
Writing & watching frontend tests (we have two test runners)
-
jest for all new tests that do not require browser context (React+more)
-
Start watcher:
`
npm
run jest`
-
Start watcher:
`
yarn
run jest`
-
Jest will run all test files that end with the name ".jest.ts"
-
karma + mocha is used for testing angularjs components. We do want to migrate these test to jest over time (if possible).
-
Start watcher:
`
npm
run karma`
-
Start watcher:
`
yarn
run karma`
-
Karma+Mocha runs all files that end with the name "_specs.ts".
#### Backend
```
bash
# Run Golang tests using sqlite3 as database (default)
go
test
./pkg/...
go
test
./pkg/...
# Run Golang tests using mysql as database - convenient to use /docker/blocks/mysql_tests
GRAFANA_TEST_DB
=
mysql go
test
./pkg/...
GRAFANA_TEST_DB
=
mysql go
test
./pkg/...
# Run Golang tests using postgres as database - convenient to use /docker/blocks/postgres_tests
GRAFANA_TEST_DB
=
postgres go
test
./pkg/...
GRAFANA_TEST_DB
=
postgres go
test
./pkg/...
```
## Building custom docker image
You can build a custom image using Docker, which doesn't require installing any dependencies besides docker itself.
```
bash
git clone https://github.com/grafana/grafana
cd
grafana
docker build
-t
grafana:dev
.
docker run
-d
--name
=
grafana
-p
3000:3000 grafana:dev
```
Open grafana in your browser (default:
`http://localhost:3000`
) and login with admin user (default:
`user/pass = admin/admin`
).
## Contribute
If you have any idea for an improvement or found a bug, do not hesitate to open an issue.
...
...
docker/run.sh
→
scripts/
docker/run.sh
100644 → 100755
View file @
c0254905
File moved
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment