Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
61dfc0a3
Unverified
Commit
61dfc0a3
authored
Sep 28, 2023
by
OptimismBot
Committed by
GitHub
Sep 28, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7455 from ethereum-optimism/fix-global-test-log
op-e2e: move global logger init, detach from tests
parents
2f4ae042
490cb99f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
14 deletions
+18
-14
init.go
op-e2e/config/init.go
+18
-0
helper.go
op-e2e/helper.go
+0
-14
No files found.
op-e2e/config/init.go
View file @
61dfc0a3
...
...
@@ -16,6 +16,7 @@ import (
"github.com/ethereum-optimism/optimism/op-chain-ops/genesis"
"github.com/ethereum-optimism/optimism/op-e2e/external"
oplog
"github.com/ethereum-optimism/optimism/op-service/log"
)
var
(
...
...
@@ -65,6 +66,23 @@ func init() {
testing
.
Init
()
// Register test flags before parsing
flag
.
Parse
()
// Setup global logger
lvl
:=
log
.
Lvl
(
EthNodeVerbosity
)
if
lvl
<
log
.
LvlCrit
{
log
.
Root
()
.
SetHandler
(
log
.
DiscardHandler
())
}
else
if
lvl
>
log
.
LvlTrace
{
// clip to trace level
lvl
=
log
.
LvlTrace
}
// We cannot attach a testlog logger,
// because the global logger is shared between different independent parallel tests.
// Tests that write to a testlogger of another finished test fail.
h
:=
oplog
.
NewLogHandler
(
os
.
Stdout
,
oplog
.
CLIConfig
{
Level
:
lvl
,
Color
:
false
,
// some CI logs do not handle colors well
Format
:
oplog
.
FormatTerminal
,
})
oplog
.
SetGlobalLogHandler
(
h
)
if
err
:=
allExist
(
l1AllocsPath
,
l1DeploymentsPath
,
deployConfigPath
);
err
!=
nil
{
return
}
...
...
op-e2e/helper.go
View file @
61dfc0a3
...
...
@@ -3,12 +3,6 @@ package op_e2e
import
(
"os"
"testing"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum-optimism/optimism/op-e2e/config"
oplog
"github.com/ethereum-optimism/optimism/op-service/log"
"github.com/ethereum-optimism/optimism/op-service/testlog"
)
var
enableParallelTesting
bool
=
os
.
Getenv
(
"OP_E2E_DISABLE_PARALLEL"
)
!=
"true"
...
...
@@ -18,12 +12,4 @@ func InitParallel(t *testing.T) {
if
enableParallelTesting
{
t
.
Parallel
()
}
lvl
:=
log
.
Lvl
(
config
.
EthNodeVerbosity
)
if
lvl
<
log
.
LvlCrit
{
log
.
Root
()
.
SetHandler
(
log
.
DiscardHandler
())
}
else
if
lvl
>
log
.
LvlTrace
{
// clip to trace level
lvl
=
log
.
LvlTrace
}
h
:=
testlog
.
Handler
(
t
,
lvl
,
log
.
TerminalFormat
(
false
))
// some CI logs do not handle colors well
oplog
.
SetGlobalLogHandler
(
h
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment