Skip to content

Commit

Permalink
test: first e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasgerstmayr committed Oct 14, 2020
1 parent 159e43f commit d5d42f6
Show file tree
Hide file tree
Showing 9 changed files with 1,415 additions and 36 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
e2e
dist
node_modules
vendor_jsonnet
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ jobs:
- name: Test
run: make test-frontend-coverage test-backend-coverage

- name: End-to-End tests
run: make test-e2e

- name: Build
run: make dist

Expand Down
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM alpine:latest AS builder
RUN apk add --no-cache make git yarn go jsonnet && \
go get -v github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb && \
mv /root/go/bin/jb /usr/local/bin

WORKDIR /usr/src/app
COPY . /usr/src/app
RUN make dist


FROM grafana/grafana:latest
COPY docker/root/etc/grafana/grafana.ini /etc/grafana/grafana.ini
COPY --from=builder /usr/src/app/dist /var/lib/grafana/plugins/grafana-pcp
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,17 @@ test-backend-web: deps-backend ## Run backend tests using goconvey
test: test-frontend test-backend ## Run all tests


##@ E2E tests

test-e2e-container:
podman build -t grafana-pcp-e2e .
-podman rm -f grafana-pcp-e2e
podman run -d -p 3001:3000 --name grafana-pcp-e2e grafana-pcp-e2e

test-e2e: test-e2e-container ## Run End-to-End tests
GRAFANA_URL="http://127.0.0.1:3001" node_modules/jest/bin/jest.js --config jest.config.e2e.js --runInBand


##@ Helpers

clean: ## Clean all artifacts
Expand Down
Loading

0 comments on commit d5d42f6

Please sign in to comment.