Skip to content

Add VSS Store CI Integ Test #161

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

Merged
merged 1 commit into from
Dec 12, 2023
Merged
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
82 changes: 82 additions & 0 deletions .github/workflows/vss-integration.yml
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that we'll want to run the usual tests against this backend, so while it might be a bit cleaner to have a separate CI worflow, we'll probably need to do this setup as part of our 'regular' CI run, possibly as part of a vss feature flag for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can do this setup in separate workflow and run all tests against it.

I didn't want to bloat single ci workflow so much and wanted to maintain some separation of concerns regarding vss-integration in particular .

Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: VSS Integration Test

on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-and-test:
runs-on: ubuntu-latest

services:
postgres:
image: postgres:latest
ports:
- 5432:5432
env:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: YOU_MUST_CHANGE_THIS_PASSWORD
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
path: ldk-node
- name: Checkout VSS
uses: actions/checkout@v3
with:
repository: lightningdevkit/vss-server
path: vss-server

- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '17'

- name: Start Tomcat
run: |
docker run -d --network=host --name tomcat tomcat:latest

- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-version: release-candidate

- name: Create database table
run: |
psql -h localhost -U postgres -d postgres -f ./vss-server/app/src/main/java/org/vss/impl/postgres/sql/v0_create_vss_db.sql
env:
PGPASSWORD: YOU_MUST_CHANGE_THIS_PASSWORD

- name: Build and Deploy VSS
run: |
# Print Info
java -version
gradle --version

cd vss-server
gradle wrapper --gradle-version 8.1.1
./gradlew --version
./gradlew build

docker cp app/build/libs/app-1.0.war tomcat:/usr/local/tomcat/webapps/vss.war
cd ../
- name: Run VSS Integration tests against vss-instance.
run: |
cd ldk-node
export TEST_VSS_BASE_URL="http://localhost:8080/vss"
RUSTFLAGS="--cfg=vss_test --cfg=vss" cargo build --verbose --color always
RUSTFLAGS="--cfg=vss_test --cfg=vss" cargo test -- --nocapture

- name: Cleanup
run: |
docker stop tomcat && docker rm tomcat