Skip to content
This repository has been archived by the owner on Sep 6, 2023. It is now read-only.

Commit

Permalink
HostFixture: retire gossamer config
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianFranzen committed Jun 2, 2022
1 parent df5e04c commit 291bb51
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 81 deletions.
20 changes: 7 additions & 13 deletions helpers/HostFixture.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,11 @@ function run_tester(self::Tester, host::String, duration::Number)
@error "Failed to locate genesis: $genesis"
end

# Helper files needed for some hosts
keystore = "$(@__DIR__)/../runtimes/$(self.runtime)/keystore"
# [gossamer] Provide empty dummy config
config, _ = mktemp()

config = "$(@__DIR__)/../runtimes/$(self.runtime)/gossamer."
if Config.docker
config *= "docker."
end
config *= if self.raw "raw" else "json" end * ".config.toml"

# Copy prepopulated kagome keystore (TODO: Load chain id from genesis)
# [kagome] Provide populated keystore (TODO: Load chain id from genesis)
keystore = "$(@__DIR__)/../runtimes/$(self.runtime)/keystore"
mkpath(joinpath(tempdir, "spectest"))
cp(keystore, joinpath(tempdir, "spectest", "keystore"))

Expand All @@ -73,7 +68,6 @@ function run_tester(self::Tester, host::String, duration::Number)
end

# Prepare command and environment based on command
cmd = ``
args = ``
if host == "substrate"
exec = `polkadot`
Expand All @@ -84,7 +78,7 @@ function run_tester(self::Tester, host::String, duration::Number)
args = `--chain $genesis -d $datadir --bootnodes /dns/localhost/tcp/30363/p2p/12D3KooWEgUjBV5FJAuBSoNMRYFRHjV7PjZwRQ7b43EKX9g7D6xV`
elseif host == "gossamer"
exec = `gossamer`
args = `--key=alice --config $config --basepath $datadir --log debug`
args = `--key=alice --genesis $genesis --config $config --basepath $datadir --log debug`
else
error("Unknown host: ", host)
end
Expand All @@ -111,15 +105,15 @@ function run_tester(self::Tester, host::String, duration::Number)

# Run for specified time
stream = Pipe()
proc = run(pipeline(cmd, stdout=stream, stderr=stream), wait=false)
proc = run(pipeline(cmd, stdout = stream, stderr = stream), wait = false)
sleep(duration)

# Stop process if necessary
crashed = !process_running(proc)
if !crashed
kill(proc)

while(process_running(proc))
while (process_running(proc))
sleep(0.1)
end
end
Expand Down
34 changes: 0 additions & 34 deletions runtimes/tester/gossamer.docker.raw.config.toml

This file was deleted.

34 changes: 0 additions & 34 deletions runtimes/tester/gossamer.raw.config.toml

This file was deleted.

0 comments on commit 291bb51

Please sign in to comment.