Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gwen4 #65

Closed
wants to merge 62 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
7d7251f
minor updates
bjuric Oct 9, 2024
0636fce
Remove report portal integration
bjuric Oct 12, 2024
393e55a
Add process option
bjuric Oct 12, 2024
0cec03f
Use Java 17
bjuric Oct 12, 2024
b63871a
Use logback-classic instead of log4j for logging
bjuric Oct 12, 2024
be9c0d5
Delete renamed implicits
bjuric Oct 12, 2024
69437ae
Safe error cause mapping
bjuric Oct 13, 2024
a6fa8de
Log deprecation warning for deprecated implicit value references
bjuric Oct 13, 2024
2c3a9db
Safe error cause mapping 2
bjuric Oct 13, 2024
5354db2
CLI options are now launch options
bjuric Oct 13, 2024
d0e6138
Raise deprecations as errors by default instead of logging them as wa…
bjuric Oct 13, 2024
a05822f
Drop deprecated DSL steps
bjuric Oct 13, 2024
3914bf3
Implement process launch option
bjuric Oct 14, 2024
1c1523c
Use java 17 for github ci
bjuric Oct 14, 2024
56a1e6d
minor ENV_PROCESS refactor
bjuric Oct 14, 2024
0548215
Replace internal stack of data caches with a single data cache (inter…
bjuric Oct 15, 2024
f3d611e
Manage settings internally without exposing them as system properties
bjuric Oct 24, 2024
7d2bcd4
Make all input data read only
bjuric Oct 25, 2024
3707b1f
Drop matrix tables
bjuric Oct 25, 2024
1e7282c
Clean up data tables
bjuric Oct 26, 2024
9ff4a5f
Do not resolve all settings during load
bjuric Oct 26, 2024
7ba8710
Transient stack cleanup
bjuric Oct 27, 2024
653fbf9
Improved scope boundaries
bjuric Oct 27, 2024
d873bd4
gwen.input.data.readOnly
bjuric Oct 27, 2024
ee54bf4
Fix settings map
bjuric Oct 28, 2024
0e631b0
restore env -a filter in repl
bjuric Oct 29, 2024
9b8d918
Add --repl option to force open REPL even if batch was specified
bjuric Oct 29, 2024
eef9367
Add --repl option to open REPL regardless of batch and feature options
bjuric Oct 29, 2024
c63f469
Check that process files exist
bjuric Oct 29, 2024
e2eff8f
Fix implicit deprecataion messages
bjuric Oct 29, 2024
d7e3c6d
Only clear for each var if set
bjuric Oct 29, 2024
4efc0c0
Update template error msg
bjuric Nov 1, 2024
37536f2
unmask urls internally
bjuric Nov 1, 2024
95e028a
overload attach DSL
bjuric Nov 1, 2024
72df2da
Include occurren no in display name of forach step
bjuric Nov 1, 2024
28a2fc5
Change ignore placeholder syntax in template matcher
bjuric Nov 2, 2024
c4ab32a
Fix mutiple ignored lines in template matcher
bjuric Nov 2, 2024
ed17f4a
Support ignoring multiple lines in template matcher
bjuric Nov 2, 2024
51935c2
improved launch error handling
bjuric Nov 2, 2024
cb28541
Drop gwen.auto.discover.data settings
bjuric Nov 4, 2024
190563c
Update dependencies
bjuric Nov 4, 2024
8caba11
Renamed process feature to profiles
bjuric Nov 4, 2024
cfe9bf5
cleanup
bjuric Nov 5, 2024
83a2644
Add data feed test
bjuric Nov 5, 2024
2c6156e
Enforce settings load order
bjuric Nov 5, 2024
6ef4ce2
Fix ref name in immutable modification exception
bjuric Nov 8, 2024
ffeb418
Force dry value bindings
bjuric Nov 8, 2024
81a8e27
Fix ref name in immutable modification exception
bjuric Nov 8, 2024
f73c5d9
Introduce defaultValue in CSV field bindings and fix settings parse
bjuric Nov 8, 2024
6999ab8
Add DSL for logging records to result files
bjuric Nov 8, 2024
9c17ce6
Renamed step function layer from lambda to action
bjuric Nov 9, 2024
a17d775
Report status to console at end of excecution
bjuric Nov 10, 2024
3d0c802
Print gwen launch arguments on startup
bjuric Nov 10, 2024
8d91c88
Updated result file DSL errors
bjuric Nov 10, 2024
21fd776
Synchronise system process bindings when resolving value from output …
bjuric Nov 11, 2024
88f037b
Only log results file records if results format is sepcified in launc…
bjuric Nov 11, 2024
14a11f1
Result file logging enhancements and restrictions
bjuric Nov 12, 2024
2423de9
Support relative file locations in Import and Examples annotations
bjuric Nov 12, 2024
4546556
Load all associative meta if features are specified with --repl option
bjuric Nov 12, 2024
ff41ff3
Auto discover associative meta only
bjuric Nov 13, 2024
5cbe740
Cleanup REPL and fix feature level results file reporting
bjuric Nov 13, 2024
37f2aaf
Pre release 4 cleanup
bjuric Nov 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
gwen.input.data.readOnly
  • Loading branch information
bjuric committed Oct 27, 2024
commit d873bd42bfc1180cbf4ab518326a9303721715b3
4 changes: 3 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
- With GraalVM instead of Nashorn for JS evaluation
- Use logback instead of log4j for logging
- Support `empty` literal in DSLs wherever `blank` is accepted
- Make all input data read only
- Make all input data read only by default
- Internal engine enhancements
- Replace internal stack of data caches with a single data cache
- Manage settings internally without exposing them as system properties
- Implicits managed at lifecycle level
- Improved scope boundaries
- Add settings(s):
- `gwen.input.data.readOnly`
- Add implicit variable(s):
- `gwen.process.name`
- Add environment variable(s)
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/gwen.conf
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ gwen {
}
mode = "declarative" # declarative|imperative
}
input {
data {
readOnly = true
}
}
launch { # Default launch options
options { # See: https://gweninterpreter.org/docs/settings#launch-settings
batch = false
Expand Down
9 changes: 9 additions & 0 deletions src/main/scala/gwen/core/GwenSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ object GwenSettings extends LazyLogging {
`gwen.video.dir`
`gwen.video.timeoutSecs`
`gwen.logLevel.deprecations`
`gwen.input.data.readOnly`
}

/**
Expand Down Expand Up @@ -516,6 +517,14 @@ object GwenSettings extends LazyLogging {
}
}

/**
* Provides access to the `gwen.input.data.readOnly` setting used to control whether or not
* input data should be read only.
*/
def `gwen.input.data.readOnly`: Boolean = {
Settings.getBoolean("gwen.input.data.readOnly")
}

def `gwen.report.results.files`(options: GwenOptions): List[ResultFile] = {
val fileSettings = Settings.findAll(_.startsWith(ResultFile.SettingsKey))
fileSettings.filter(_._1.endsWith(".file")).keys.map(_.drop(ResultFile.SettingsKey.length + 1).dropRight(".file".length)).toList.sorted map { id =>
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/gwen/core/eval/GwenREPL.scala
Original file line number Diff line number Diff line change
Expand Up @@ -210,15 +210,15 @@ class GwenREPL[T <: EvalContext](val engine: EvalEngine[T], ctx: T) extends Impl
}

private def enteringLoop(): Unit = {
// repl always runs in imperative and lenient mode
Settings.setLocal("gwen.feature.mode", FeatureMode.imperative.toString)
Settings.setLocal("gwen.behavior.rules", BehaviorMode.lenient.toString)
Settings.setLocal("gwen.input.data.readOnly", false.toString)

}
private def exitingLoop(): Unit = {
// remove local imperative and lenient mode overrides
Settings.clearLocal("gwen.feature.mode")
Settings.clearLocal("gwen.behavior.rules")
Settings.clearLocal("gwen.input.data.readOnly")
}

/** Reads all input lines from the command line. */
Expand Down
9 changes: 7 additions & 2 deletions src/main/scala/gwen/core/state/Mutability.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package gwen.core.state

import gwen.core.Errors
import gwen.core.GwenSettings
import gwen.core.state.Environment
import gwen.core.node.gherkin.Annotations

Expand All @@ -28,11 +29,15 @@ trait Mutability {

def checkMutability(name: String, scopedData: ScopedData): Unit = {
scopedData.getOpt(key(name)).map(Annotations.valueOf) foreach { annotation =>
Errors.immutableModificationError(name, annotation)
if (GwenSettings.`gwen.input.data.readOnly`) {
Errors.immutableModificationError(name, annotation)
}
}
}

def setReadOnly(name: String, annotation: Annotations, scopedData: ScopedData): Unit = {
scopedData.set(key(name), annotation.toString, force = true)
if (GwenSettings.`gwen.input.data.readOnly`) {
scopedData.set(key(name), annotation.toString, force = true)
}
}
}
1 change: 1 addition & 0 deletions src/test/scala/gwen/core/GwenSettingsTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,6 @@ class GwenSettingsTest extends BaseTest with Matchers {
GwenSettings.`gwen.error.messages.inline.locators` should be (false)
GwenSettings.`gwen.logLevel.deprecations` should be (Level.SEVERE)
GwenSettings.`gwen.report.results.files`(GwenOptions()).length should be (0)
GwenSettings.`gwen.input.data.readOnly` should be (true)
}
}
Loading