Skip to content

Commit

Permalink
Use built integration package in system tests
Browse files Browse the repository at this point in the history
Now that we're using `external: ecs` in fields/ecs.yml,
we need to use the output of `elastic-package build`
rather than using the integration package source directly.
This goes for the system tests (i.e. what we mount into
the package-registry container), and also for what we
copy to package-storage.
  • Loading branch information
axw committed Oct 15, 2021
1 parent 72f6a16 commit d032da1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 29 deletions.
12 changes: 2 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,13 @@ docker-compose.override.yml:
# Rules for updating config files, fields.yml, etc.
##############################################################################

update: fields go-generate add-headers copy-docs gen-package notice $(MAGE)
update: fields go-generate add-headers copy-docs build-package notice $(MAGE)
@$(MAGE) update

fields_sources=\
$(shell find model -name fields.yml) \
$(shell find x-pack/apm-server/fields -name fields.yml)

.PHONY: gen-package gen-package-only
gen-package: gen-package-only format-package build-package
gen-package-only: $(GENPACKAGE)
@$(GENPACKAGE)

fields: include/fields.go x-pack/apm-server/include/fields.go
include/fields.go x-pack/apm-server/include/fields.go: $(MAGE) magefile.go $(fields_sources)
@$(MAGE) fields
Expand Down Expand Up @@ -232,6 +227,7 @@ check-package: $(ELASTICPACKAGE)
format-package: $(ELASTICPACKAGE)
@(cd apmpackage/apm; $(CURDIR)/$(ELASTICPACKAGE) format)
build-package: $(ELASTICPACKAGE)
@rm -fr ./build/integrations/apm/*
@(cd apmpackage/apm; $(CURDIR)/$(ELASTICPACKAGE) build)

.PHONY: check-gofmt check-autopep8 gofmt autopep8
Expand Down Expand Up @@ -262,10 +258,6 @@ $(BIN_MAGE): go.mod
$(MAGE): magefile.go $(BIN_MAGE)
$(BIN_MAGE) -compile=$@

.PHONY: $(GENPACKAGE)
$(GENPACKAGE):
@$(GO) build -o $@ github.com/elastic/apm-server/apmpackage/cmd/gen-package

$(GOLINT): go.mod
$(GO) build -o $@ golang.org/x/lint/golint

Expand Down
3 changes: 2 additions & 1 deletion apmpackage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@

1. Actual work
- Make changes in `apmpackage/apm` and/or code as needed
- Run `make build-package`

2. Run the registry
- Checkout a fresh master from the registry and run `mage build`
- Copy `apmpackage/apm` in apm-server to `build/package-storage/packages/apm/<version>` in the registry
- Copy `build/integrations/apm/<version>` in apm-server to `build/package-storage/packages/apm/<version>` in the registry
- `go run .`

3. Run the stack
Expand Down
4 changes: 1 addition & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,10 @@ services:
image: docker.elastic.co/package-registry/distribution:snapshot
ports:
- 8080
entrypoint: /entrypoint.sh
healthcheck:
test: ["CMD-SHELL", "curl --fail localhost:8080/health"]
retries: 100
interval: 5s
volumes:
- "./testing/docker/package-registry/entrypoint.sh:/entrypoint.sh"
- "./testing/docker/package-registry/config.yml:/package-registry/config.yml"
- "./apmpackage:/apmpackage" # copied to /packages/local/apm/<version> by entrypoint.sh
- "./build/integrations/apm:/packages/local/apm"
15 changes: 0 additions & 15 deletions testing/docker/package-registry/entrypoint.sh

This file was deleted.

0 comments on commit d032da1

Please sign in to comment.