mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-13 19:37:37 +01:00
Run tests inside container
This commit is contained in:
parent
9ca85ed365
commit
d85247d2ad
4 changed files with 32 additions and 32 deletions
|
@ -12,18 +12,8 @@ jobs:
|
||||||
- checkout
|
- checkout
|
||||||
- run:
|
- run:
|
||||||
command: |
|
command: |
|
||||||
lsb_release -a
|
|
||||||
wget -q https://packages.microsoft.com/config/ubuntu/14.04/packages-microsoft-prod.deb
|
|
||||||
sudo dpkg -i packages-microsoft-prod.deb
|
|
||||||
sudo apt-get install apt-transport-https
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install dotnet-sdk-2.1
|
|
||||||
dotnet --info
|
|
||||||
dotnet build /p:TreatWarningsAsErrors=true
|
|
||||||
cd BTCPayServer.Tests
|
cd BTCPayServer.Tests
|
||||||
dotnet test --filter Fast=Fast
|
docker-compose run tests
|
||||||
docker-compose up -d dev
|
|
||||||
dotnet test --filter Integration=Integration
|
|
||||||
|
|
||||||
# publish jobs require $DOCKERHUB_REPO, $DOCKERHUB_USER, $DOCKERHUB_PASS defined
|
# publish jobs require $DOCKERHUB_REPO, $DOCKERHUB_USER, $DOCKERHUB_PASS defined
|
||||||
publish_docker_linuxamd64:
|
publish_docker_linuxamd64:
|
||||||
|
|
|
@ -1,12 +1,17 @@
|
||||||
FROM microsoft/dotnet:2.1.403-sdk-alpine3.7
|
FROM microsoft/dotnet:2.1.500-sdk-alpine3.7 AS builder
|
||||||
WORKDIR /app
|
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT false
|
||||||
# caches restore result by copying csproj file separately
|
RUN apk add --no-cache icu-libs
|
||||||
COPY BTCPayServer.Tests/BTCPayServer.Tests.csproj BTCPayServer.Tests/BTCPayServer.Tests.csproj
|
ENV LC_ALL en_US.UTF-8
|
||||||
|
ENV LANG en_US.UTF-8
|
||||||
|
|
||||||
|
# This should be removed soon https://github.com/dotnet/corefx/issues/30003
|
||||||
|
RUN apk add --no-cache curl
|
||||||
|
|
||||||
|
WORKDIR /source
|
||||||
COPY BTCPayServer/BTCPayServer.csproj BTCPayServer/BTCPayServer.csproj
|
COPY BTCPayServer/BTCPayServer.csproj BTCPayServer/BTCPayServer.csproj
|
||||||
|
COPY BTCPayServer.Tests/BTCPayServer.Tests.csproj BTCPayServer.Tests/BTCPayServer.Tests.csproj
|
||||||
WORKDIR /app/BTCPayServer.Tests
|
RUN dotnet restore BTCPayServer.Tests/BTCPayServer.Tests.csproj
|
||||||
RUN dotnet restore
|
COPY . .
|
||||||
# copies the rest of your code
|
RUN dotnet build
|
||||||
COPY . ../.
|
WORKDIR /source/BTCPayServer.Tests
|
||||||
|
ENTRYPOINT ["./docker-entrypoint.sh"]
|
||||||
ENTRYPOINT ["dotnet", "test"]
|
|
||||||
|
|
|
@ -19,10 +19,10 @@ services:
|
||||||
TESTS_MYSQL: User ID=root;Host=mysql;Port=3306;Database=btcpayserver
|
TESTS_MYSQL: User ID=root;Host=mysql;Port=3306;Database=btcpayserver
|
||||||
TESTS_PORT: 80
|
TESTS_PORT: 80
|
||||||
TESTS_HOSTNAME: tests
|
TESTS_HOSTNAME: tests
|
||||||
TEST_MERCHANTLIGHTNINGD: "type=clightning;server=/etc/merchant_lightningd_datadir/lightning-rpc"
|
TEST_MERCHANTLIGHTNINGD: "type=clightning;server=unix://etc/merchant_lightningd_datadir/lightning-rpc"
|
||||||
TEST_CUSTOMERLIGHTNINGD: "type=clightning;server=/etc/customer_lightningd_datadir/lightning-rpc"
|
TEST_CUSTOMERLIGHTNINGD: "type=clightning;server=unix://etc/customer_lightningd_datadir/lightning-rpc"
|
||||||
TEST_MERCHANTCHARGE: "type=charge;server=https://lightning-charged:9112/;api-token=foiewnccewuify;allowinsecure=true"
|
TEST_MERCHANTCHARGE: "type=charge;server=http://lightning-charged:9112/;api-token=foiewnccewuify"
|
||||||
TEST_MERCHANTLND: "type=lnd-rest;server=https://lnd:lnd@127.0.0.1:53280/;allowinsecure=true"
|
TEST_MERCHANTLND: "https://lnd:lnd@merchant_lnd:8080/"
|
||||||
TESTS_INCONTAINER: "true"
|
TESTS_INCONTAINER: "true"
|
||||||
expose:
|
expose:
|
||||||
- "80"
|
- "80"
|
||||||
|
@ -36,7 +36,7 @@ services:
|
||||||
|
|
||||||
# The dev container is not actually used, it is just handy to run `docker-compose up dev` to start all services
|
# The dev container is not actually used, it is just handy to run `docker-compose up dev` to start all services
|
||||||
dev:
|
dev:
|
||||||
image: nicolasdorier/docker-bitcoin:0.17.0
|
image: btcpayserver/bitcoin:0.17.0
|
||||||
environment:
|
environment:
|
||||||
BITCOIN_NETWORK: regtest
|
BITCOIN_NETWORK: regtest
|
||||||
BITCOIN_EXTRA_ARGS: |
|
BITCOIN_EXTRA_ARGS: |
|
||||||
|
@ -53,7 +53,7 @@ services:
|
||||||
- merchant_lnd
|
- merchant_lnd
|
||||||
|
|
||||||
devlnd:
|
devlnd:
|
||||||
image: nicolasdorier/docker-bitcoin:0.17.0
|
image: btcpayserver/bitcoin:0.17.0
|
||||||
environment:
|
environment:
|
||||||
BITCOIN_NETWORK: regtest
|
BITCOIN_NETWORK: regtest
|
||||||
BITCOIN_EXTRA_ARGS: |
|
BITCOIN_EXTRA_ARGS: |
|
||||||
|
@ -94,7 +94,7 @@ services:
|
||||||
- litecoind
|
- litecoind
|
||||||
|
|
||||||
bitcoind:
|
bitcoind:
|
||||||
image: nicolasdorier/docker-bitcoin:0.17.0
|
image: btcpayserver/bitcoin:0.17.0
|
||||||
environment:
|
environment:
|
||||||
BITCOIN_NETWORK: regtest
|
BITCOIN_NETWORK: regtest
|
||||||
BITCOIN_EXTRA_ARGS: |
|
BITCOIN_EXTRA_ARGS: |
|
||||||
|
@ -118,7 +118,7 @@ services:
|
||||||
- "bitcoin_datadir:/data"
|
- "bitcoin_datadir:/data"
|
||||||
|
|
||||||
customer_lightningd:
|
customer_lightningd:
|
||||||
image: nicolasdorier/clightning:v0.6.2-3-dev
|
image: btcpayserver/lightning:v0.6.2-dev
|
||||||
stop_signal: SIGKILL
|
stop_signal: SIGKILL
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
|
@ -164,7 +164,7 @@ services:
|
||||||
- merchant_lightningd
|
- merchant_lightningd
|
||||||
|
|
||||||
merchant_lightningd:
|
merchant_lightningd:
|
||||||
image: nicolasdorier/clightning:v0.6.2-3-dev
|
image: btcpayserver/lightning:v0.6.2-dev
|
||||||
stop_signal: SIGKILL
|
stop_signal: SIGKILL
|
||||||
environment:
|
environment:
|
||||||
EXPOSE_TCP: "true"
|
EXPOSE_TCP: "true"
|
||||||
|
@ -188,7 +188,7 @@ services:
|
||||||
- bitcoind
|
- bitcoind
|
||||||
|
|
||||||
litecoind:
|
litecoind:
|
||||||
image: nicolasdorier/docker-litecoin:0.15.1
|
image: nicolasdorier/docker-litecoin:0.16.3
|
||||||
environment:
|
environment:
|
||||||
BITCOIN_EXTRA_ARGS: |
|
BITCOIN_EXTRA_ARGS: |
|
||||||
rpcuser=ceiwHEbqWI83
|
rpcuser=ceiwHEbqWI83
|
||||||
|
|
5
BTCPayServer.Tests/docker-entrypoint.sh
Executable file
5
BTCPayServer.Tests/docker-entrypoint.sh
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
dotnet test --filter Fast=Fast --no-build
|
||||||
|
dotnet test --filter Integration=Integration --no-build
|
Loading…
Add table
Reference in a new issue