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

Fix e2e tests after soroban-rpc -> stellar-rpc rename #333

Merged
merged 2 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 3 additions & 4 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
# the soroban CLI & RPC source code to compile and run from system test
# refers to checked out source of current git hub ref context
SYSTEM_TEST_SOROBAN_CLI_REF: https://github.com/stellar/soroban-cli.git\#main
SYSTEM_TEST_SOROBAN_RPC_REF: ${{ github.workspace }}/stellar-rpc
SYSTEM_TEST_STELLAR_RPC_REF: ${{ github.workspace }}/stellar-rpc

# core git ref should be latest commit for stable soroban functionality
# the core bin can either be compiled in-line here as part of ci,
Expand Down Expand Up @@ -54,8 +54,7 @@ jobs:

# system test will build quickstart image internally to use for running the service stack
# configured in standalone network mode(core, rpc)
SYSTEM_TEST_QUICKSTART_GIT_REF: https://github.com/stellar/quickstart.git#ae7fdb07283a0af836d4cd51ff09b02db93fb12c

SYSTEM_TEST_QUICKSTART_GIT_REF: https://github.com/stellar/quickstart.git#1a831b2350dd3928b60eb745d0862ee19dd2aaaa
# triggers system test to log out details from quickstart's logs and test steps
SYSTEM_TEST_VERBOSE_OUTPUT: "true"

Expand Down Expand Up @@ -104,7 +103,7 @@ jobs:
CORE_COMPILE_CONFIGURE_FLAGS="$SYSTEM_TEST_CORE_COMPILE_CONFIGURE_FLAGS" \
CORE_IMAGE=$SYSTEM_TEST_CORE_IMAGE \
CORE_IMAGE_BIN_PATH=$SYSTEM_TEST_CORE_IMAGE_BIN_PATH \
SOROBAN_RPC_GIT_REF=$SYSTEM_TEST_SOROBAN_RPC_REF \
STELLAR_RPC_GIT_REF=$SYSTEM_TEST_STELLAR_RPC_REF \
SOROBAN_CLI_GIT_REF=$SYSTEM_TEST_SOROBAN_CLI_REF \
RUST_TOOLCHAIN_VERSION=$SYSTEM_TEST_RUST_TOOLCHAIN_VERSION \
RS_XDR_GIT_REF=$SYSTEM_TEST_RS_XDR_GIT_REF \
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/stellar-rpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ jobs:
protocol-version: [ 21, 22 ]
runs-on: ${{ matrix.os }}
env:
SOROBAN_RPC_INTEGRATION_TESTS_ENABLED: true
SOROBAN_RPC_INTEGRATION_TESTS_CORE_MAX_SUPPORTED_PROTOCOL: ${{ matrix.protocol-version }}
SOROBAN_RPC_INTEGRATION_TESTS_CAPTIVE_CORE_BIN: /usr/bin/stellar-core
STELLAR_RPC_INTEGRATION_TESTS_ENABLED: true
STELLAR_RPC_INTEGRATION_TESTS_CORE_MAX_SUPPORTED_PROTOCOL: ${{ matrix.protocol-version }}
STELLAR_RPC_INTEGRATION_TESTS_CAPTIVE_CORE_BIN: /usr/bin/stellar-core
PROTOCOL_21_CORE_DEBIAN_PKG_VERSION: 22.0.0-2138.721fd0a65.focal
PROTOCOL_21_CORE_DOCKER_IMG: stellar/stellar-core:22.0.0-2138.721fd0a65.focal
PROTOCOL_22_CORE_DEBIAN_PKG_VERSION: 22.0.0-2138.721fd0a65.focal
Expand All @@ -124,7 +124,7 @@ jobs:
shell: bash
run: |
docker pull "$PROTOCOL_${{ matrix.protocol-version }}_CORE_DOCKER_IMG"
echo SOROBAN_RPC_INTEGRATION_TESTS_DOCKER_IMG="$PROTOCOL_${{ matrix.protocol-version }}_CORE_DOCKER_IMG" >> $GITHUB_ENV
echo STELLAR_RPC_INTEGRATION_TESTS_DOCKER_IMG="$PROTOCOL_${{ matrix.protocol-version }}_CORE_DOCKER_IMG" >> $GITHUB_ENV

- name: Install Captive Core
shell: bash
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ endif
# (libpreflight.a is put at target/release-with-panic-unwind/ when not cross compiling)
CARGO_BUILD_TARGET ?= $(shell rustc -vV | sed -n 's|host: ||p')

SOROBAN_RPC_BINARY := stellar-rpc
STELLAR_RPC_BINARY := stellar-rpc
STELLAR_RPC_BINARY := stellar-rpc


Expand Down Expand Up @@ -86,7 +86,7 @@ clean:
# https://github.com/stellar/pipelines/blob/master/stellar-rpc/Jenkinsfile-stellar-rpc-package-builder
# as part of the package building.
build-stellar-rpc: build-libs
go build -ldflags="${GOLDFLAGS}" ${MACOS_MIN_VER} -o ${SOROBAN_RPC_BINARY} -trimpath -v ./cmd/stellar-rpc
go build -ldflags="${GOLDFLAGS}" ${MACOS_MIN_VER} -o ${STELLAR_RPC_BINARY} -trimpath -v ./cmd/stellar-rpc

# the build-stellar-rpc build target is an optimized build target used by
# https://github.com/stellar/pipelines/blob/master/stellar-rpc/Jenkinsfile-stellar-rpc-package-builder
Expand Down
6 changes: 3 additions & 3 deletions cmd/stellar-rpc/docker/Dockerfile.release
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM ubuntu:22.04
ARG STELLAR_CORE_VERSION
ENV STELLAR_CORE_VERSION=${STELLAR_CORE_VERSION:-*}
ARG SOROBAN_RPC_VERSION
ENV SOROBAN_RPC_VERSION=${SOROBAN_RPC_VERSION:-*}
ARG STELLAR_RPC_VERSION
ENV STELLAR_RPC_VERSION=${STELLAR_RPC_VERSION:-*}

ENV STELLAR_CORE_BINARY_PATH /usr/bin/stellar-core
ENV DEBIAN_FRONTEND=noninteractive
Expand All @@ -14,7 +14,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates
echo "deb https://apt.stellar.org focal testing" >/etc/apt/sources.list.d/SDF-testing.list && \
echo "deb https://apt.stellar.org focal unstable" >/etc/apt/sources.list.d/SDF-unstable.list && \
apt-get update && \
apt-get install -y stellar-core=${STELLAR_CORE_VERSION} stellar-stellar-rpc=${SOROBAN_RPC_VERSION} && \
apt-get install -y stellar-core=${STELLAR_CORE_VERSION} stellar-stellar-rpc=${STELLAR_RPC_VERSION} && \
apt-get clean

ENTRYPOINT ["/usr/bin/stellar-stellar-rpc"]
20 changes: 10 additions & 10 deletions cmd/stellar-rpc/docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ SUDO := $(shell docker version >/dev/null 2>&1 || echo "sudo")
BUILD_DATE := $(shell date -u +%FT%TZ)

# Extract latest release semver from GitHub
SOROBAN_RPC_LATEST_RELEASE := $(shell curl -sS https://api.github.com/repos/stellar/stellar-rpc/releases/latest|jq -r ".tag_name"| tr -d "v" )
STELLAR_RPC_LATEST_RELEASE := $(shell curl -sS https://api.github.com/repos/stellar/stellar-rpc/releases/latest|jq -r ".tag_name"| tr -d "v" )

# If deb version was provided via the SOROBAN_RPC_VERSION variable use it.
# If deb version was provided via the STELLAR_RPC_VERSION variable use it.
# If not get latest deb build matching release from GitHub
ifndef SOROBAN_RPC_VERSION
SOROBAN_RPC_VERSION_PACKAGE_VERSION := $(shell curl -sS https://apt.stellar.org/dists/focal/unstable/binary-amd64/Packages|grep -A 18 stellar-stellar-rpc|grep Version|grep $(SOROBAN_RPC_LATEST_RELEASE)|head -1|cut -d' ' -f2 )
ifndef STELLAR_RPC_VERSION
STELLAR_RPC_VERSION_PACKAGE_VERSION := $(shell curl -sS https://apt.stellar.org/dists/focal/unstable/binary-amd64/Packages|grep -A 18 stellar-stellar-rpc|grep Version|grep $(STELLAR_RPC_LATEST_RELEASE)|head -1|cut -d' ' -f2 )
else
SOROBAN_RPC_VERSION_PACKAGE_VERSION := $(SOROBAN_RPC_VERSION)
STELLAR_RPC_VERSION_PACKAGE_VERSION := $(STELLAR_RPC_VERSION)
endif

ifndef SOROBAN_RPC_VERSION_PACKAGE_VERSION
$(error Couldn't establish deb build from version $(SOROBAN_RPC_LATEST_RELEASE). Has the package been built?)
ifndef STELLAR_RPC_VERSION_PACKAGE_VERSION
$(error Couldn't establish deb build from version $(STELLAR_RPC_LATEST_RELEASE). Has the package been built?)
endif

ifndef STELLAR_CORE_VERSION
Expand All @@ -28,17 +28,17 @@ BINARY_NAME ?= stellar-rpc
ifndef TAG
# Set the TAG based on the value of BINARY_NAME
ifeq ($(BINARY_NAME),stellar-rpc)
TAG := stellar/stellar-rpc:$(SOROBAN_RPC_VERSION_PACKAGE_VERSION)
TAG := stellar/stellar-rpc:$(STELLAR_RPC_VERSION_PACKAGE_VERSION)
else
TAG := stellar/stellar-stellar-rpc:$(SOROBAN_RPC_VERSION_PACKAGE_VERSION)
TAG := stellar/stellar-stellar-rpc:$(STELLAR_RPC_VERSION_PACKAGE_VERSION)
endif
endif # TAG


docker-build:
$(SUDO) docker build --pull --platform linux/amd64 $(DOCKER_OPTS) \
--label org.opencontainers.image.created="$(BUILD_DATE)" \
--build-arg STELLAR_CORE_VERSION=$(STELLAR_CORE_VERSION) --build-arg SOROBAN_RPC_VERSION=$(SOROBAN_RPC_VERSION_PACKAGE_VERSION) \
--build-arg STELLAR_CORE_VERSION=$(STELLAR_CORE_VERSION) --build-arg STELLAR_RPC_VERSION=$(STELLAR_RPC_VERSION_PACKAGE_VERSION) \
--build-arg BINARY_NAME=$(BINARY_NAME) \
-t $(TAG) -f Dockerfile.release .

Expand Down
6 changes: 3 additions & 3 deletions cmd/stellar-rpc/internal/config/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ func (cfg *Config) options() Options {
cfg.optionsCache = &Options{
{
Name: "config-path",
EnvVar: "SOROBAN_RPC_CONFIG_PATH",
EnvVar: "STELLAR_RPC_CONFIG_PATH",
TomlKey: "-",
Usage: "File path to the toml configuration file",
ConfigKey: &cfg.ConfigPath,
},
{
Name: "config-strict",
EnvVar: "SOROBAN_RPC_CONFIG_STRICT",
EnvVar: "STELLAR_RPC_CONFIG_STRICT",
2opremio marked this conversation as resolved.
Show resolved Hide resolved
TomlKey: "STRICT",
Usage: "Enable strict toml configuration file parsing. This will prevent unknown fields in the config toml from being parsed.",
ConfigKey: &cfg.Strict,
Expand Down Expand Up @@ -200,7 +200,7 @@ func (cfg *Config) options() Options {
Name: "db-path",
Usage: "SQLite DB path",
ConfigKey: &cfg.SQLiteDBPath,
DefaultValue: "soroban_rpc.sqlite",
DefaultValue: "stellar_rpc.sqlite",
2opremio marked this conversation as resolved.
Show resolved Hide resolved
},
{
Name: "ingestion-timeout",
Expand Down
2 changes: 1 addition & 1 deletion cmd/stellar-rpc/internal/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
)

const (
prometheusNamespace = "soroban_rpc"
prometheusNamespace = "stellar_rpc"
2opremio marked this conversation as resolved.
Show resolved Hide resolved
maxLedgerEntryWriteBatchSize = 150
defaultReadTimeout = 5 * time.Second
defaultShutdownGracePeriod = 10 * time.Second
Expand Down
2 changes: 1 addition & 1 deletion cmd/stellar-rpc/internal/daemon/interfaces/noOpDaemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type NoOpDaemon struct {
func MakeNoOpDeamon() *NoOpDaemon {
return &NoOpDaemon{
metricsRegistry: prometheus.NewRegistry(),
metricsNamespace: "soroban_rpc",
metricsNamespace: "stellar_rpc",
coreClient: noOpCoreClient{},
}
}
Expand Down
14 changes: 7 additions & 7 deletions cmd/stellar-rpc/internal/integrationtest/infrastructure/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ type Test struct {
}

func NewTest(t *testing.T, cfg *TestConfig) *Test {
if os.Getenv("SOROBAN_RPC_INTEGRATION_TESTS_ENABLED") == "" {
t.Skip("skipping integration test: SOROBAN_RPC_INTEGRATION_TESTS_ENABLED not set")
if os.Getenv("STELLAR_RPC_INTEGRATION_TESTS_ENABLED") == "" {
t.Skip("skipping integration test: STELLAR_RPC_INTEGRATION_TESTS_ENABLED not set")
}
i := &Test{t: t}

Expand All @@ -137,7 +137,7 @@ func NewTest(t *testing.T, cfg *TestConfig) *Test {
}

if i.sqlitePath == "" {
i.sqlitePath = path.Join(i.t.TempDir(), "soroban_rpc.sqlite")
i.sqlitePath = path.Join(i.t.TempDir(), "stellar_rpc.sqlite")
}

if parallel {
Expand Down Expand Up @@ -276,9 +276,9 @@ func (i *Test) getRPConfigForContainer() rpcConfig {
}

func (i *Test) getRPConfigForDaemon() rpcConfig {
coreBinaryPath := os.Getenv("SOROBAN_RPC_INTEGRATION_TESTS_CAPTIVE_CORE_BIN")
coreBinaryPath := os.Getenv("STELLAR_RPC_INTEGRATION_TESTS_CAPTIVE_CORE_BIN")
if coreBinaryPath == "" {
i.t.Fatal("missing SOROBAN_RPC_INTEGRATION_TESTS_CAPTIVE_CORE_BIN")
i.t.Fatal("missing STELLAR_RPC_INTEGRATION_TESTS_CAPTIVE_CORE_BIN")
}
return rpcConfig{
// Allocate port dynamically and then figure out what the port is
Expand Down Expand Up @@ -479,7 +479,7 @@ func (i *Test) getComposeCommand(args ...string) *exec.Cmd {
cmd = exec.Command("docker", cmdline...)
}

if img := os.Getenv("SOROBAN_RPC_INTEGRATION_TESTS_DOCKER_IMG"); img != "" {
if img := os.Getenv("STELLAR_RPC_INTEGRATION_TESTS_DOCKER_IMG"); img != "" {
cmd.Env = append(
cmd.Env,
"CORE_IMAGE="+img,
Expand Down Expand Up @@ -722,7 +722,7 @@ func (i *Test) fillContainerPorts() {
}

func GetCoreMaxSupportedProtocol() uint32 {
str := os.Getenv("SOROBAN_RPC_INTEGRATION_TESTS_CORE_MAX_SUPPORTED_PROTOCOL")
str := os.Getenv("STELLAR_RPC_INTEGRATION_TESTS_CORE_MAX_SUPPORTED_PROTOCOL")
if str == "" {
return MaxSupportedProtocolVersion
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/stellar-rpc/internal/integrationtest/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestMetrics(t *testing.T) {
require.NoError(t, err)
metrics := getMetrics(t, metricsURL)
buildMetric := fmt.Sprintf(
"soroban_rpc_build_info{branch=\"%s\",build_timestamp=\"%s\",commit=\"%s\",goversion=\"%s\",version=\"%s\"} 1",
"stellar_rpc_build_info{branch=\"%s\",build_timestamp=\"%s\",commit=\"%s\",goversion=\"%s\",version=\"%s\"} 1",
config.Branch,
config.BuildTimestamp,
config.CommitHash,
Expand All @@ -42,7 +42,7 @@ func TestMetrics(t *testing.T) {
assert.NoError(t, err)
var metric *io_prometheus_client.MetricFamily
for _, mf := range metricFamilies {
if mf.GetName() == "soroban_rpc_log_error_total" {
if mf.GetName() == "stellar_rpc_log_error_total" {
metric = mf
break
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/stellar-rpc/internal/preflight/preflight_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ func createLedger(ledgerSequence uint32) xdr.LedgerCloseMeta {
}

func getDB(t testing.TB, restartDB bool) *db.DB {
dbPath := path.Join(t.TempDir(), "soroban_rpc.sqlite")
dbPath := path.Join(t.TempDir(), "stellar_rpc.sqlite")
dbInstance, err := db.OpenSQLiteDB(dbPath)
require.NoError(t, err)

Expand Down
Loading