Skip to content

Commit b697d89

Browse files
committed
Ensure we configure network correctly
Signed-off-by: Ryan Levick <[email protected]>
1 parent 8fafa09 commit b697d89

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

crates/trigger/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
pub mod cli;
22
pub mod loader;
3-
mod network;
3+
pub mod network;
44
mod runtime_config;
55
mod stdio;
66

tests/runtime-tests/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ impl RuntimeTest<InProcessSpin> {
124124
Ok(())
125125
};
126126
let services_config = services_config(&config)?;
127-
let env_config = TestEnvironmentConfig::in_memory(services_config, preboot);
127+
let env_config = TestEnvironmentConfig::in_process(services_config, preboot);
128128
let env = TestEnvironment::up(env_config)?;
129129
Ok(Self {
130130
test_path: config.test_path,

tests/testing-framework/src/test_environment.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ impl TestEnvironmentConfig<SpinCli> {
193193
}
194194

195195
impl TestEnvironmentConfig<InProcessSpin> {
196-
pub fn in_memory(
196+
pub fn in_process(
197197
services_config: ServicesConfig,
198198
preboot: impl FnOnce(&mut TestEnvironment<InProcessSpin>) -> anyhow::Result<()> + 'static,
199199
) -> Self {
@@ -219,7 +219,10 @@ impl TestEnvironmentConfig<InProcessSpin> {
219219
std::fs::write(env.path().join("locked.json"), json)?;
220220

221221
let loader = TriggerLoader::new(env.path().join(".working_dir"), false);
222-
let trigger = TriggerExecutorBuilder::<HttpTrigger>::new(loader)
222+
let mut builder = TriggerExecutorBuilder::<HttpTrigger>::new(loader);
223+
// TODO(rylev): see if we can reuse the builder from spin_trigger instead of duplicating it here
224+
builder.hooks(spin_trigger::network::Network);
225+
let trigger = builder
223226
.build(
224227
format!("file:{}", env.path().join("locked.json").display()),
225228
RuntimeConfig::default(),

0 commit comments

Comments
 (0)