Skip to content

Commit a4400da

Browse files
committed
refactor: contract fixtures and simplification
1 parent febcc1d commit a4400da

12 files changed

Lines changed: 376 additions & 419 deletions

File tree

.github/workflows/integration-tests.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ jobs:
5252
sudo apt-get clean &
5353
wait
5454
55-
- name: Install stable toolchain
55+
- name: Install Rust 1.91 toolchain
5656
uses: actions-rs/toolchain@v1
5757
with:
5858
profile: minimal
59-
toolchain: stable
59+
toolchain: 1.91.0
6060
default: true
6161
target: wasm32-unknown-unknown
6262
components: rust-src, clippy
@@ -81,11 +81,16 @@ jobs:
8181
key: pop-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}
8282

8383
- name: Install pop
84-
run: cargo install --locked --force pop-cli
84+
run: cargo install --locked --force --git https://github.com/r0gue-io/pop-cli --branch main
8585

8686
- name: Bootstrap pop binaries
8787
run: sudo "$(which pop)" install -y
8888

89+
- name: Smoke test ink-node
90+
run: |
91+
pop up ink-node -y --detach
92+
pop clean node --all
93+
8994
- name: Run integration tests
9095
env:
9196
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[toolchain]
2-
channel = "stable"
2+
channel = "1.91.0"
33
profile = "minimal"
44
components = ["rustfmt", "clippy", "rust-src", "llvm-tools-preview"]
55
targets = ["wasm32-unknown-unknown"]

src/executor.rs

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//! Command execution for Pop CLI
22
3-
#[cfg(feature = "pop-e2e")]
4-
use std::ffi::OsString;
53
#[cfg(feature = "pop-e2e")]
64
use std::path::PathBuf;
75
use std::process::Command;
@@ -43,49 +41,31 @@ impl CommandOutput {
4341
/// Real implementation of Pop CLI command executor.
4442
///
4543
/// When the `pop-e2e` feature is enabled, the executor supports optional
46-
/// working directory and environment overrides for test isolation.
44+
/// working directory override for test isolation.
4745
#[derive(Debug, Clone, Default)]
4846
pub struct PopExecutor {
49-
/// Override working directory for command execution (pop-e2e only).
5047
#[cfg(feature = "pop-e2e")]
5148
cwd: Option<PathBuf>,
52-
/// Environment variable overrides (pop-e2e only).
53-
#[cfg(feature = "pop-e2e")]
54-
env: Vec<(OsString, OsString)>,
5549
}
5650

5751
impl PopExecutor {
5852
pub fn new() -> Self {
5953
Self::default()
6054
}
6155

62-
/// Create an executor with working directory and environment overrides.
63-
///
64-
/// This is only available in `pop-e2e` builds for test isolation.
56+
/// Create an executor with a working directory override.
6557
#[cfg(feature = "pop-e2e")]
66-
pub fn with_overrides(
67-
cwd: Option<PathBuf>,
68-
env: impl IntoIterator<Item = (impl Into<OsString>, impl Into<OsString>)>,
69-
) -> Self {
70-
Self {
71-
cwd,
72-
env: env.into_iter().map(|(k, v)| (k.into(), v.into())).collect(),
73-
}
58+
pub fn with_cwd(cwd: PathBuf) -> Self {
59+
Self { cwd: Some(cwd) }
7460
}
7561

7662
fn execute_raw(&self, args: &[&str]) -> PopMcpResult<CommandOutput> {
7763
let mut cmd = Command::new("pop");
7864
cmd.args(args);
7965

80-
// Apply overrides when pop-e2e feature is enabled
8166
#[cfg(feature = "pop-e2e")]
82-
{
83-
if let Some(ref cwd) = self.cwd {
84-
cmd.current_dir(cwd);
85-
}
86-
if !self.env.is_empty() {
87-
cmd.envs(self.env.iter().map(|(k, v)| (k, v)));
88-
}
67+
if let Some(ref cwd) = self.cwd {
68+
cmd.current_dir(cwd);
8969
}
9070

9171
let output = cmd.output().map_err(|e| {

0 commit comments

Comments
 (0)