Skip to content

Commit

Permalink
Minor tweaks to run integration tests in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
tompntn committed Jan 17, 2023
1 parent c273112 commit 57304fc
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 26 deletions.
1 change: 0 additions & 1 deletion .github/workflows/rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ on:

jobs:
build:

runs-on: ubuntu-20.04
steps:
- name: Check-out code
Expand Down
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
FROM python:3.10-bullseye
FROM python:3.10-slim-bullseye

# Install Rust
RUN apt update && apt install -y curl pkg-config libssl-dev build-essential
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
RUN rustup toolchain install nightly

# Install poetry
RUN pip install poetry
ENV PATH="${PATH}:/{$HOME}/.local/bin"
ENV PATH="${PATH}:/root/.local/bin"
RUN poetry config virtualenvs.in-project true

# Install Solana Tool Suite
RUN sh -c "$(curl -sSfL https://release.solana.com/v1.14.11/install)"
ENV PATH="${PATH}:/root/.local/share/solana/install/active_release/bin"

ADD . /agent
WORKDIR /agent

RUN apt update && apt install -y pkg-config libssl-dev
RUN cargo build --release
65 changes: 46 additions & 19 deletions integration-tests/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions integration-tests/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ program-admin = { git = "https://github.com/pyth-network/program-admin.git", bra
pytest = "^7.2"
pytest-asyncio = "^0.18.3"
pre-commit = "^2.21.0"
jsonrpc_websocket = "^3.1.4"

[build-system]
requires = ["poetry-core"]
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,13 +300,13 @@ def agent_keystore(self, agent_keystore_path, agent_publish_keypair):
@pytest.fixture
def agent(self, sync_accounts, agent_keystore, tmp_path):
LOGGER.debug("Building agent binary")
self.run("cargo build")
self.run("cargo build --release")

log_dir = os.path.join(tmp_path, "agent_logs")
LOGGER.debug("Launching agent logging to %s", log_dir)

os.environ["RUST_BACKTRACE"] = "full"
with self.spawn("../target/debug/agent --config agent_conf.toml", log_dir=log_dir):
with self.spawn("../target/release/agent --config agent_conf.toml", log_dir=log_dir):
time.sleep(3)
yield

Expand Down
3 changes: 2 additions & 1 deletion tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ cargo test --workspace

# Run Python integration tests
cd integration-tests
pytest -s --log-cli-level=debug
poetry install
poetry run pytest -s --log-cli-level=debug

0 comments on commit 57304fc

Please sign in to comment.