mirror of
https://github.com/scroll-tech/scroll.git
synced 2026-01-09 14:08:03 -05:00
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com> Co-authored-by: Péter Garamvölgyi <peter@scroll.io>
48 lines
1.3 KiB
Go
48 lines
1.3 KiB
Go
package utils
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/docker/docker/pkg/reexec"
|
|
"github.com/urfave/cli/v2"
|
|
)
|
|
|
|
// MockAppName a new type mock app.
|
|
type MockAppName string
|
|
|
|
var (
|
|
// EventWatcherApp the name of mock event-watcher app.
|
|
EventWatcherApp MockAppName = "event-watcher-test"
|
|
// GasOracleApp the name of mock gas-oracle app.
|
|
GasOracleApp MockAppName = "gas-oracle-test"
|
|
// MessageRelayerApp the name of mock message-relayer app.
|
|
MessageRelayerApp MockAppName = "message-relayer-test"
|
|
// RollupRelayerApp the name of mock rollup-relayer app.
|
|
RollupRelayerApp MockAppName = "rollup-relayer-test"
|
|
|
|
// DBCliApp the name of mock database app.
|
|
DBCliApp MockAppName = "db_cli-test"
|
|
|
|
// CoordinatorApp the name of mock coordinator app.
|
|
CoordinatorApp MockAppName = "coordinator-test"
|
|
|
|
// ChunkProverApp the name of mock chunk prover app.
|
|
ChunkProverApp MockAppName = "chunkProver-test"
|
|
// BatchProverApp the name of mock batch prover app.
|
|
BatchProverApp MockAppName = "batchProver-test"
|
|
)
|
|
|
|
// RegisterSimulation register initializer function for integration-test.
|
|
func RegisterSimulation(app *cli.App, name MockAppName) {
|
|
// Run the app for integration-test
|
|
reexec.Register(string(name), func() {
|
|
if err := app.Run(os.Args); err != nil {
|
|
fmt.Fprintln(os.Stderr, err)
|
|
os.Exit(1)
|
|
}
|
|
os.Exit(0)
|
|
})
|
|
reexec.Init()
|
|
}
|