Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[t] use Test::APIcast from CPAN #528

Merged
merged 2 commits into from
Dec 20, 2017
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
15 changes: 12 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
environment:
S2I_VERSION: "1.1.7-226afa1"
DOCKER_COMPOSE_VERSION: "1.16.1"
OPENRESTY_VERSION: "1.13.6.1-rover2"
OPENRESTY_VERSION: "1.13.6.1-rover3"
steps:
- run: apk update && apk add wget make bash curl py-pip git openssh-client
- run: |
Expand Down Expand Up @@ -37,7 +37,7 @@ jobs:
- run: make prove-docker
build:
docker:
- image: quay.io/3scale/s2i-openresty-centos7:1.13.6.1-rover2
- image: quay.io/3scale/s2i-openresty-centos7:1.13.6.1-rover3
environment:
TEST_NGINX_BINARY: openresty
LUA_BIN_PATH: /opt/app-root/bin
Expand All @@ -58,11 +58,20 @@ jobs:
- lua_modules
- run: mkdir -p tmp/junit
- run: $(make rover) exec make busted
- restore_cache:
keys:
- apicast-cpanm-{{ arch }}-{{ checksum "gateway/cpanfile" }}
- apicast-cpanm-{{ arch }}-{{ .Branch }}
- apicast-cpanm-{{ arch }}-master
- run:
command: make prove
command: /usr/libexec/s2i/entrypoint make prove
environment:
JUNIT_OUTPUT_FILE: tmp/junit/prove.xml
HARNESS: TAP::Harness::JUnit
- save_cache:
key: apicast-cpanm-{{ arch }}-{{ checksum "gateway/cpanfile" }}
paths:
- ~/perl5
- store_test_results:
path: tmp/junit
- store_artifacts:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

- Consolidate apicast-0.1-0.rockspec into apicast-scm-1.rockspec [PR #526](https://github.com/3scale/apicast/pull/526)
- Deprecated `Configuration.extract_usage` in favor of `Service.get_usage` [PR #531](https://github.com/3scale/apicast/pull/531)
- Extract Test::APIcast to own package on CPAN [PR #528](https://github.com/3scale/apicast/pull/528)

## [3.2.0-alpha2] - 2017-11-30

Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ ifeq ($(ROVER),)
ROVER := lua_modules/bin/rover
endif

CPANM ?= $(shell command -v cpanm 2> /dev/null)

export COMPOSE_PROJECT_NAME

test: ## Run all tests
Expand All @@ -53,6 +55,10 @@ nginx:
prove: HARNESS ?= TAP::Harness
prove: export TEST_NGINX_RANDOMIZE=1
prove: $(ROVER) nginx ## Test nginx
ifeq ($(CPANM),)
$(error Missing cpanminus. Install it by running `curl -L https://cpanmin.us | perl - App::cpanminus`)
endif
$(CPANM) --installdeps ./gateway
$(ROVER) exec prove -j$(NPROC) --harness=$(HARNESS) 2>&1 | awk '/found ONLY/ { print "FAIL: because found ONLY in test"; print; exit 1 }; { print }'

prove-docker: apicast-source
Expand Down
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,10 @@ services:
prove:
image: ${IMAGE_NAME:-apicast-test}
user: root
entrypoint: "bash -ec"
environment:
TEST_NGINX_BINARY: openresty
TEST_NGINX_REDIS_HOST: redis
command: "'$$TEST_NGINX_BINARY -V; cd ; make prove; exit $$?'"
command: "sh -ec '$$TEST_NGINX_BINARY -V; cd ; /usr/libexec/s2i/entrypoint make prove; exit $$?'"
dns_search:
- example.com
depends_on:
Expand Down
3 changes: 3 additions & 0 deletions gateway/cpanfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
requires 'Test::APIcast', '0.03';
requires 'JSON::WebToken';
requires 'Crypt::OpenSSL::RSA';
152 changes: 0 additions & 152 deletions t/TestAPIcast.pm

This file was deleted.

157 changes: 0 additions & 157 deletions t/TestAPIcastBlackbox.pm

This file was deleted.

Loading