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
04b4611d
Unverified
Commit
04b4611d
authored
Oct 27, 2023
by
Adrian Sutton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-e2e: Use unsigned ints to avoid negatives.
parent
7d51ff39
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
helper.go
op-e2e/helper.go
+5
-5
No files found.
op-e2e/helper.go
View file @
04b4611d
...
@@ -9,7 +9,7 @@ import (
...
@@ -9,7 +9,7 @@ import (
var
enableParallelTesting
bool
=
os
.
Getenv
(
"OP_E2E_DISABLE_PARALLEL"
)
!=
"true"
var
enableParallelTesting
bool
=
os
.
Getenv
(
"OP_E2E_DISABLE_PARALLEL"
)
!=
"true"
type
testopts
struct
{
type
testopts
struct
{
executor
int
executor
uint64
}
}
func
InitParallel
(
t
*
testing
.
T
,
args
...
func
(
t
*
testing
.
T
,
opts
*
testopts
))
{
func
InitParallel
(
t
*
testing
.
T
,
args
...
func
(
t
*
testing
.
T
,
opts
*
testopts
))
{
...
@@ -37,13 +37,13 @@ func UsesCannon(t *testing.T, opts *testopts) {
...
@@ -37,13 +37,13 @@ func UsesCannon(t *testing.T, opts *testopts) {
// InitParallel(t, UseExecutor(1))
// InitParallel(t, UseExecutor(1))
// Any tests assigned to an executor greater than the number available automatically use the last executor.
// Any tests assigned to an executor greater than the number available automatically use the last executor.
// Executor indexes start from 0
// Executor indexes start from 0
func
UseExecutor
(
assignedIdx
int
)
func
(
t
*
testing
.
T
,
opts
*
testopts
)
{
func
UseExecutor
(
assignedIdx
uint64
)
func
(
t
*
testing
.
T
,
opts
*
testopts
)
{
return
func
(
t
*
testing
.
T
,
opts
*
testopts
)
{
return
func
(
t
*
testing
.
T
,
opts
*
testopts
)
{
opts
.
executor
=
assignedIdx
opts
.
executor
=
assignedIdx
}
}
}
}
func
checkExecutor
(
t
*
testing
.
T
,
assignedIdx
int
)
{
func
checkExecutor
(
t
*
testing
.
T
,
assignedIdx
uint64
)
{
envTotal
:=
os
.
Getenv
(
"CIRCLE_NODE_TOTAL"
)
envTotal
:=
os
.
Getenv
(
"CIRCLE_NODE_TOTAL"
)
envIdx
:=
os
.
Getenv
(
"CIRCLE_NODE_INDEX"
)
envIdx
:=
os
.
Getenv
(
"CIRCLE_NODE_INDEX"
)
if
envTotal
==
""
||
envIdx
==
""
{
if
envTotal
==
""
||
envIdx
==
""
{
...
@@ -51,11 +51,11 @@ func checkExecutor(t *testing.T, assignedIdx int) {
...
@@ -51,11 +51,11 @@ func checkExecutor(t *testing.T, assignedIdx int) {
t
.
Logf
(
"Running test. Test splitting not in use."
)
t
.
Logf
(
"Running test. Test splitting not in use."
)
return
return
}
}
total
,
err
:=
strconv
.
Atoi
(
envTotal
)
total
,
err
:=
strconv
.
ParseUint
(
envTotal
,
10
,
0
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"Could not parse CIRCLE_NODE_TOTAL env var %v: %v"
,
envTotal
,
err
)
t
.
Fatalf
(
"Could not parse CIRCLE_NODE_TOTAL env var %v: %v"
,
envTotal
,
err
)
}
}
idx
,
err
:=
strconv
.
Atoi
(
envIdx
)
idx
,
err
:=
strconv
.
ParseUint
(
envIdx
,
10
,
0
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"Could not parse CIRCLE_NODE_INDEX env var %v: %v"
,
envIdx
,
err
)
t
.
Fatalf
(
"Could not parse CIRCLE_NODE_INDEX env var %v: %v"
,
envIdx
,
err
)
}
}
...
...
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