Repository navigation
Conversation
commit: |
✅ Testplane browser-env run succeed
|
✅ Testplane E2E run succeed
|
| const plugin = path.join(directory, "events.js"); | ||
| await fs.writeFile( | ||
| plugin, | ||
| `module.exports = testplane => { |
There was a problem hiding this comment.
This looks hard to read & maintain. If we want some sort of integration test here, why not create the needed files in a separate fixture folder and copy them as needed. I think it would be simpler & cleaner.
|
|
||
| exitOnError: section({ | ||
| enabled: options.boolean("exitOnError.enabled"), | ||
| filters: option({ |
There was a problem hiding this comment.
I am a bit skeptical of this shape.
First, the object is 100% reduntant here and the wrong shape to use. If we choose to preserve the overall idea of this PR, I'd use something like this:
stopOnErrors: {
rules: [
{ filter: /Service unavailable/, limit: 2 },
{ filter: text => text.includes('Something'), limit: 20 },
],
}
We could support passing exitOnErrors: false to make it easy to disable via env vars for example. Much simpler & cleaner IMO.
However, I would think more about the API shape... We already have patterns on reject. With a very simple shape: regexp array. And I think they strongly correlate. So what about this:
system: {
patternsOnReject: myPatternsTemplate,
maxFailures: 20, // Stops after any 20 errors
maxFailures: { // OR, in object shape like this
limit: 20,
patterns: myPatternsTemplate, // <-- Easy reuse of the existing patterns
}
}
This shape is even easier to work with & lets reuse existing patterns on reject collection that users already have! We can even consider defaulting to those patterns, but this might be unexpected for some users.
Let's discuss.
6053333 to
8ef1395
Compare
Uh oh!
There was an error while loading. Please reload this page.