Skip to content
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 @@ -3,3 +3,4 @@ dist/
bin/
.SCRATCH
.vscode/
coverage.txt
34 changes: 11 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ GENNY=$(BIN)/genny

## Test tools.
GO_JUNIT_REPORT=$(BIN)/go-junit-report
GOVERALLS=$(BIN)/goveralls

## Release tools.
GORELEASER=$(BIN)/goreleaser
Expand All @@ -35,9 +34,6 @@ $(GENNY):
$(GO_JUNIT_REPORT):
go get -u -v github.com/jstemmer/go-junit-report

$(GOVERALLS):
go get -u -v github.com/mattn/goveralls

$(GORELEASER): $(DEP)
go get -d github.com/goreleaser/goreleaser
cd $$GOPATH/src/github.com/goreleaser/goreleaser
Expand All @@ -62,17 +58,17 @@ $(BIN)/fossa: $(GO_BINDATA) $(GENNY) $(DEP)
# Building various Docker images.
.PHONY:
docker-base: ./docker/base/Dockerfile
sudo docker build -t fossa/fossa-cli:base -f ./docker/base/Dockerfile .
sudo docker build -t fossa/fossa-cli:base -f ./docker/base/Dockerfile $(DOCKER_FLAGS) .

.PHONY:
docker-buildtools: docker-base ./docker/buildtools/Dockerfile
sudo docker build -t fossa/fossa-cli:buildtools -f ./docker/buildtools/Dockerfile .
sudo docker build -t fossa/fossa-cli:buildtools -f ./docker/buildtools/Dockerfile $(DOCKER_FLAGS) .

## TODO: we will deprecate this image once native integration tests are
## completely ready.
.PHONY:
docker-fixtures: docker-buildtools ./docker/fixtures/Dockerfile
sudo docker build -t fossa/fossa-cli:fixtures -f ./docker/fixtures/Dockerfile .
sudo docker build -t fossa/fossa-cli:fixtures -f ./docker/fixtures/Dockerfile $(DOCKER_FLAGS) .

# Development tasks.
.PHONY: dev
Expand Down Expand Up @@ -107,31 +103,23 @@ test:

.PHONY: unit-test
unit-test:
go test -short ./...
go test -short -covermode=atomic $(GO_TEST_FLAGS) ./...

.PHONY: ci-unit-test
ci-unit-test: $(GO_JUNIT_REPORT) $(GOVERALLS)
if [ -z "$${COVERALLS_TOKEN}" ]; then \
go test -short -v ./... | go-junit-report; \
else \
goveralls -v -service=circle-ci -repotoken=$(COVERALLS_TOKEN) -flags "-short" | go-junit-report; \
fi
ci-unit-test: $(GO_JUNIT_REPORT)
GO_TEST_FLAGS="-coverprofile=coverage.txt -v" make -s unit-test | go-junit-report;
if [ -n "$${CODECOV_TOKEN}" ]; then curl -s https://codecov.io/bash | bash 1>&2; fi

.PHONY: integration-test
integration-test:
# Ensure the binary is recompiled before every test.
make
go test ./...
go test -covermode=atomic $(GO_TEST_FLAGS) ./...

.PHONY: ci-integration-test
ci-integration-test:
# Ensure the binary is recompiled before every test.
make
if [ -z "$${COVERALLS_TOKEN}" ]; then \
go test -v ./... | go-junit-report; \
else \
goveralls -v -service=circle-ci -repotoken=$(COVERALLS_TOKEN) | go-junit-report; \
fi
ci-integration-test: $(GO_JUNIT_REPORT)
GO_TEST_FLAGS="-coverprofile=coverage.txt -v" make -s integration-test | go-junit-report;
if [ -n "$${CODECOV_TOKEN}" ]; then curl -s https://codecov.io/bash | bash 1>&2; fi

# Release tasks.
install.sh: $(GODOWNLOADER)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
<a href="http://slack.fossa.io/">
<img src="https://slack.fossa.io/badge.svg">
</a>
<a href='https://coveralls.io/github/fossas/fossa-cli?branch=master'>
<img src='https://coveralls.io/repos/github/fossas/fossa-cli/badge.svg?branch=master' alt='coverage status' />
<a href="https://codecov.io/gh/fossas/fossa-cli">
<img src="https://codecov.io/gh/fossas/fossa-cli/branch/master/graph/badge.svg" />
</a>
</p>

Expand Down
1 change: 0 additions & 1 deletion docker/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@ RUN mkdir -p $GOPATH/bin && \
go get -u -v github.com/go-bindata/go-bindata/... && \
go get -u -v github.com/cheekybits/genny && \
go get -u -v github.com/jstemmer/go-junit-report && \
go get -u -v github.com/mattn/goveralls && \
go get -u -v github.com/derekparker/delve/cmd/dlv
13 changes: 6 additions & 7 deletions docker/buildtools/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ FROM fossa/fossa-cli:base
# https://github.com/oerdnj/deb.sury.org/issues/56).
ENV LC_ALL=C.UTF-8 DEBIAN_FRONTEND=noninteractive

# Install build tool requirements.
# Install build tool and fixture requirements.
RUN sudo apt-get install -y \
apt-transport-https build-essential libssl-dev software-properties-common
# Build tools
apt-transport-https build-essential libssl-dev software-properties-common \
# Rails (nokogiri)
zlib1g-dev liblzma-dev libncurses5-dev libtool autoconf libxml2-dev \
libmysqlclient-dev postgresql-server-dev-all libsqlite3-dev

# Install JVM version manager.
RUN sudo apt-get install -y zip unzip && \
Expand Down Expand Up @@ -82,8 +86,3 @@ RUN sudo apt-key adv --keyserver packages.microsoft.com --recv-keys EB3E94ADBE12
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-bionic-prod bionic main" > /etc/apt/sources.list.d/dotnetdev.list' && \
sudo apt-get update && \
sudo apt-get install -y dotnet-sdk-2.1

# Add native tools for rails project fixture.
RUN sudo apt-get install -y \
zlib1g-dev liblzma-dev libncurses5-dev libtool autoconf libxml2-dev \
libmysqlclient-dev postgresql-server-dev-all libsqlite3-dev