good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
github
maticnetwork
bor
Commits
85afdeef
Unverified
Commit
85afdeef
authored
3 years ago
by
baptiste-b-pegasys
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
tests: remove whitelist feature (#23297)
parent
860184d5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/init_test.go
+4
-25
4 additions, 25 deletions
tests/init_test.go
with
4 additions
and
25 deletions
tests/init_test.go
+
4
−
25
View file @
85afdeef
...
...
@@ -89,11 +89,10 @@ func findLine(data []byte, offset int64) (line int) {
// testMatcher controls skipping and chain config assignment to tests.
type
testMatcher
struct
{
configpat
[]
testConfig
failpat
[]
testFailure
skiploadpat
[]
*
regexp
.
Regexp
slowpat
[]
*
regexp
.
Regexp
whitelistpat
*
regexp
.
Regexp
configpat
[]
testConfig
failpat
[]
testFailure
skiploadpat
[]
*
regexp
.
Regexp
slowpat
[]
*
regexp
.
Regexp
}
type
testConfig
struct
{
...
...
@@ -124,10 +123,6 @@ func (tm *testMatcher) fails(pattern string, reason string) {
tm
.
failpat
=
append
(
tm
.
failpat
,
testFailure
{
regexp
.
MustCompile
(
pattern
),
reason
})
}
func
(
tm
*
testMatcher
)
whitelist
(
pattern
string
)
{
tm
.
whitelistpat
=
regexp
.
MustCompile
(
pattern
)
}
// config defines chain config for tests matching the pattern.
func
(
tm
*
testMatcher
)
config
(
pattern
string
,
cfg
params
.
ChainConfig
)
{
tm
.
configpat
=
append
(
tm
.
configpat
,
testConfig
{
regexp
.
MustCompile
(
pattern
),
cfg
})
...
...
@@ -217,11 +212,6 @@ func (tm *testMatcher) runTestFile(t *testing.T, path, name string, runTest inte
if
r
,
_
:=
tm
.
findSkip
(
name
);
r
!=
""
{
t
.
Skip
(
r
)
}
if
tm
.
whitelistpat
!=
nil
{
if
!
tm
.
whitelistpat
.
MatchString
(
name
)
{
t
.
Skip
(
"Skipped by whitelist"
)
}
}
t
.
Parallel
()
// Load the file as map[string]<testType>.
...
...
@@ -275,14 +265,3 @@ func runTestFunc(runTest interface{}, t *testing.T, name string, m reflect.Value
m
.
MapIndex
(
reflect
.
ValueOf
(
key
)),
})
}
func
TestMatcherWhitelist
(
t
*
testing
.
T
)
{
t
.
Parallel
()
tm
:=
new
(
testMatcher
)
tm
.
whitelist
(
"invalid*"
)
tm
.
walk
(
t
,
rlpTestDir
,
func
(
t
*
testing
.
T
,
name
string
,
test
*
RLPTest
)
{
if
name
[
:
len
(
"invalidRLPTest.json"
)]
!=
"invalidRLPTest.json"
{
t
.
Fatalf
(
"invalid test found: %s != invalidRLPTest.json"
,
name
)
}
})
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment