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
39 changes: 39 additions & 0 deletions .github/actions/setup-go/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Setup Go from go.mod
description: Detect the Go toolchain version from go.mod and install it with caching enabled
outputs:
version:
description: Detected Go version
value: ${{ steps.determine.outputs.version }}
runs:
using: composite
steps:
- id: determine
name: Determine Go version
shell: bash
run: |
set -euo pipefail

VERSION=""
TOOLCHAIN_VERSION=$(grep -E '^toolchain go[0-9]+\.[0-9]+(\.[0-9]+)?$' go.mod | cut -d ' ' -f 2 | sed 's/^go//' || true)
if [ -n "$TOOLCHAIN_VERSION" ]; then
VERSION="$TOOLCHAIN_VERSION"
echo "Detected toolchain directive: go$VERSION"
else
VERSION=$(grep -E '^go [0-9]+\.[0-9]+(\.[0-9]+)?$' go.mod | cut -d ' ' -f 2 || true)
if [ -n "$VERSION" ]; then
echo "Detected go directive: $VERSION"
fi
fi

if [ -z "$VERSION" ]; then
echo "Unable to determine Go version from go.mod" >&2
exit 1
fi

echo "version=$VERSION" >> "$GITHUB_OUTPUT"

- name: Setup Go
uses: actions/setup-go@v6.2.0
with:
go-version: ${{ steps.determine.outputs.version }}
cache: true
35 changes: 35 additions & 0 deletions .github/workflows/ica-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: ICA Integration Tests

on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
workflow_dispatch:
inputs:
lumera_version:
description: "Lumera version to test (e.g. v1.10.1)"
required: false
default: "v1.10.1"

env:
LUMERA_VERSION: ${{ github.event.inputs.lumera_version || 'v1.10.1' }}

jobs:
full-test:
name: Full Test (build + genesis + ICA)
runs-on: ubuntu-latest
timeout-minutes: 45

steps:
- name: Checkout
uses: actions/checkout@v6.0.1

- name: Set up Go
uses: ./.github/actions/setup-go

- name: Build Docker image
run: make build-docker LUMERA_VERSION=${{ env.LUMERA_VERSION }}

- name: Run tests
run: make test-local LUMERA_VERSION=${{ env.LUMERA_VERSION }}
24 changes: 5 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN apk add --no-cache \

# Download and install lumerad binary + libwasmvm from GitHub releases
# The real binary is installed as lumerad-bin; lumerad is a wrapper that strips
# --x-crisis-skip-assert-invariants (hardcoded by interchaintest but unsupported)
# --x-crisis-skip-assert-invariants (hardcoded by interchaintest but removed in v1.10.1)
RUN mkdir -p /tmp/release && \
curl -sSfL "https://github.com/LumeraProtocol/lumera/releases/download/${LUMERA_VERSION}/lumera_${LUMERA_VERSION}_linux_amd64.tar.gz" \
| tar -xz -C /tmp/release && \
Expand All @@ -28,10 +28,11 @@ RUN mkdir -p /tmp/release && \
rm -rf /tmp/release && \
lumerad-bin version

# Create wrapper script that filters unsupported flags and ensures claims.csv exists
# Create wrapper that strips --x-crisis-skip-assert-invariants (interchaintest
# hardcodes it, but the crisis module was removed in v1.10.1) and ensures
# claims.csv exists for the --claims-path flag.
RUN cat > /usr/local/bin/lumerad <<'WRAPPER'
#!/bin/bash
# Ensure claims.csv exists (lumerad requires it at startup)
[ -f /tmp/claims.csv ] || touch /tmp/claims.csv
args=()
for arg in "$@"; do
Expand All @@ -44,31 +45,16 @@ exec lumerad-bin "${args[@]}"
WRAPPER
RUN chmod +x /usr/local/bin/lumerad

# Copy claims.csv to temp location
# Copy claims.csv (used via --claims-path /tmp/claims.csv in AdditionalStartArgs)
COPY claims.csv /tmp/claims.csv

# Create lumera user
RUN addgroup -g 1025 lumera && \
adduser -D -u 1025 -G lumera lumera

# Create entrypoint script that ensures claims.csv is in .lumera/config
RUN cat > /usr/local/bin/entrypoint.sh <<'ENTRY'
#!/bin/bash
set -e
if [ -f /tmp/claims.csv ] && [ -s /tmp/claims.csv ]; then
mkdir -p $HOME/.lumera/config
if [ ! -f $HOME/.lumera/config/claims.csv ]; then
cp /tmp/claims.csv $HOME/.lumera/config/claims.csv
fi
fi
exec "$@"
ENTRY
RUN chmod +x /usr/local/bin/entrypoint.sh

USER lumera
WORKDIR /home/lumera

EXPOSE 26656 26657 1317 9090

ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["lumerad", "start"]
112 changes: 27 additions & 85 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,55 +1,35 @@
.PHONY: help build-docker clean-docker docker-info verify
.PHONY: test test-local test-v1.9.1 test-v1.10.1 test-v1.9.1-local test-v1.10.1-local
.PHONY: test-genesis test-genesis-local test-genesis-v1.9.1 test-genesis-v1.10.1 test-genesis-v1.9.1-local test-genesis-v1.10.1-local
.PHONY: test-ica test-ica-local test-ica-v1.9.1 test-ica-v1.10.1 test-ica-v1.9.1-local test-ica-v1.10.1-local
.PHONY: test-all-versions test-all-versions-local full-test
.PHONY: test test-local test-genesis test-genesis-local test-ica test-ica-local full-test

# Lumera version — override via: make test LUMERA_VERSION=v1.10.1
LUMERA_VERSION ?= v1.10.1

# Default target
help:
@echo "Lumera Interchaintest Makefile"
@echo ""
@echo " LUMERA_VERSION=$(LUMERA_VERSION) (override with LUMERA_VERSION=vX.Y.Z)"
@echo ""
@echo "Docker:"
@echo " build-docker Build lumerad Docker image from local source"
@echo " build-docker Build lumerad Docker image"
@echo " clean-docker Remove local Docker images"
@echo " docker-info Show Docker image info"
@echo " verify Verify local setup"
@echo ""
@echo "Genesis tests:"
@echo " test-genesis-v1.9.1 Test genesis for v1.9.1"
@echo " test-genesis-v1.10.1 Test genesis for v1.10.1"
@echo " test-genesis-v1.9.1-local ... with local image"
@echo " test-genesis-v1.10.1-local ... with local image"
@echo ""
@echo "ICA tests:"
@echo " test-ica-v1.9.1 Run ICA tests for v1.9.1"
@echo " test-ica-v1.10.1 Run ICA tests for v1.10.1"
@echo " test-ica-v1.9.1-local ... with local image"
@echo " test-ica-v1.10.1-local ... with local image"
@echo ""
@echo "All tests for a version:"
@echo " test-v1.9.1 Run all tests for v1.9.1"
@echo " test-v1.10.1 Run all tests for v1.10.1"
@echo " test-v1.9.1-local ... with local image"
@echo " test-v1.10.1-local ... with local image"
@echo ""
@echo "Shortcuts (default v1.10.1):"
@echo " test-genesis Test genesis (v1.10.1)"
@echo "Tests:"
@echo " test-genesis Test genesis configuration"
@echo " test-genesis-local Test genesis with local image"
@echo " test-ica Run ICA tests (v1.10.1)"
@echo " test-ica Run ICA tests"
@echo " test-ica-local Run ICA tests with local image"
@echo " test Run all tests (v1.10.1)"
@echo " test Run all tests"
@echo " test-local Run all tests with local image"
@echo ""
@echo "Multi-version:"
@echo " test-all-versions Test both v1.9.1 and v1.10.1"
@echo " test-all-versions-local Test both versions with local image"
@echo " full-test Build + test all versions locally"
@echo " full-test Build + run all tests locally"

# ── Docker ──────────────────────────────────────────────

build-docker:
@echo "Building lumerad Docker image..."
./build-docker.sh
LUMERA_VERSION=$(LUMERA_VERSION) ./build-docker.sh

clean-docker:
-docker rmi lumerad-local:local 2>/dev/null || true
Expand All @@ -67,64 +47,26 @@ verify:

# ── Genesis tests ───────────────────────────────────────

test-genesis-v1.9.1:
LUMERA_VERSION=v1.9.1 go test -v -timeout 10m -run TestLumeraGenesisSetup

test-genesis-v1.10.1:
LUMERA_VERSION=v1.10.1 go test -v -timeout 10m -run TestLumeraGenesisSetup

test-genesis-v1.9.1-local: build-docker
LUMERA_VERSION=v1.9.1 USE_LOCAL_IMAGE=true go test -v -timeout 10m -run TestLumeraGenesisSetup

test-genesis-v1.10.1-local: build-docker
LUMERA_VERSION=v1.10.1 USE_LOCAL_IMAGE=true go test -v -timeout 10m -run TestLumeraGenesisSetup
test-genesis:
LUMERA_VERSION=$(LUMERA_VERSION) go test -v -timeout 10m -run TestLumeraGenesisSetup

# Shortcuts (default v1.10.1)
test-genesis: test-genesis-v1.10.1
test-genesis-local: test-genesis-v1.10.1-local
test-genesis-local: build-docker
LUMERA_VERSION=$(LUMERA_VERSION) USE_LOCAL_IMAGE=true go test -v -timeout 10m -run TestLumeraGenesisSetup

# ── ICA tests ───────────────────────────────────────────

test-ica-v1.9.1:
LUMERA_VERSION=v1.9.1 go test -v -timeout 20m -run TestOsmosisLumeraICA

test-ica-v1.10.1:
LUMERA_VERSION=v1.10.1 go test -v -timeout 20m -run TestOsmosisLumeraICA

test-ica-v1.9.1-local: build-docker
LUMERA_VERSION=v1.9.1 USE_LOCAL_IMAGE=true go test -v -timeout 20m -run TestOsmosisLumeraICA

test-ica-v1.10.1-local: build-docker
LUMERA_VERSION=v1.10.1 USE_LOCAL_IMAGE=true go test -v -timeout 20m -run TestOsmosisLumeraICA

# Shortcuts (default v1.10.1)
test-ica: test-ica-v1.10.1
test-ica-local: test-ica-v1.10.1-local

# ── All tests for a version ─────────────────────────────

test-v1.9.1:
LUMERA_VERSION=v1.9.1 go test -v -timeout 30m ./...

test-v1.10.1:
LUMERA_VERSION=v1.10.1 go test -v -timeout 30m ./...

test-v1.9.1-local: build-docker
LUMERA_VERSION=v1.9.1 USE_LOCAL_IMAGE=true go test -v -timeout 30m ./...

test-v1.10.1-local: build-docker
LUMERA_VERSION=v1.10.1 USE_LOCAL_IMAGE=true go test -v -timeout 30m ./...
test-ica:
LUMERA_VERSION=$(LUMERA_VERSION) go test -v -timeout 20m -run TestOsmosisLumeraICA

# Shortcuts (default v1.10.1)
test: test-v1.10.1
test-local: test-v1.10.1-local
test-ica-local: build-docker
LUMERA_VERSION=$(LUMERA_VERSION) USE_LOCAL_IMAGE=true go test -v -timeout 20m -run TestOsmosisLumeraICA

# ── Multi-version ───────────────────────────────────────
# ── All tests ───────────────────────────────────────────

test-all-versions:
go test -v -timeout 30m -run TestBothVersions
test:
LUMERA_VERSION=$(LUMERA_VERSION) go test -v -timeout 30m ./...

test-all-versions-local: build-docker
USE_LOCAL_IMAGE=true go test -v -timeout 30m -run TestBothVersions
test-local: build-docker
LUMERA_VERSION=$(LUMERA_VERSION) USE_LOCAL_IMAGE=true go test -v -timeout 30m ./...

full-test: build-docker test-all-versions-local
full-test: test-local
Loading