Port more test cases to the DSL with SORT, STAT and $CORES - #815
Conversation
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
🤖 Augment PR SummarySummary: This PR ports additional shell-based CLI tests to the Python Changes:
Technical Notes:
🤖 Was this summary useful? React with 👍 or 👎 |
| @@ -0,0 +1,30 @@ | |||
| // The shell original slept for a second so that a rewrite would show up even | |||
| // at one second timestamp granularity. Modern filesystems record nanoseconds, | |||
| // so an immediate rewrite is detectable without the delay | |||
There was a problem hiding this comment.
test/format/pass_single_intact_mtime.clitest:3: This assumes nanosecond mtime resolution, but this test now runs on every platform and temporary directories can be backed by filesystems with coarser resolution. A formatter that rewrites the identical file within the same timestamp tick would still pass, so the migrated test no longer reliably enforces the no-rewrite guarantee.
Severity: low
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
There was a problem hiding this comment.
1 issue found across 18 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="test/format/pass_single_intact_mtime.clitest">
<violation number="1" location="test/format/pass_single_intact_mtime.clitest:16">
P3: This test now runs on every platform (previously UNIX-only), but it relies on nanosecond mtime resolution via STAT MTIME without any delay between writes. On filesystems or platforms with coarser mtime granularity, a formatter that rewrites the identical file within the same timestamp tick would still pass this check, so the migrated test may no longer reliably enforce the no-rewrite guarantee that the original shell test (with its 1-second sleep) guaranteed.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
|
|
||
| COPY schema.json TO original.json | ||
|
|
||
| STAT MTIME schema.json INTO mtime_before.txt |
There was a problem hiding this comment.
P3: This test now runs on every platform (previously UNIX-only), but it relies on nanosecond mtime resolution via STAT MTIME without any delay between writes. On filesystems or platforms with coarser mtime granularity, a formatter that rewrites the identical file within the same timestamp tick would still pass this check, so the migrated test may no longer reliably enforce the no-rewrite guarantee that the original shell test (with its 1-second sleep) guaranteed.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At test/format/pass_single_intact_mtime.clitest, line 16:
<comment>This test now runs on every platform (previously UNIX-only), but it relies on nanosecond mtime resolution via STAT MTIME without any delay between writes. On filesystems or platforms with coarser mtime granularity, a formatter that rewrites the identical file within the same timestamp tick would still pass this check, so the migrated test may no longer reliably enforce the no-rewrite guarantee that the original shell test (with its 1-second sleep) guaranteed.</comment>
<file context>
@@ -0,0 +1,30 @@
+
+COPY schema.json TO original.json
+
+STAT MTIME schema.json INTO mtime_before.txt
+
+RUN fmt schema.json STDIN /dev/null IN . INTO result_0.txt EXPECTING 0
</file context>
Signed-off-by: Juan Cruz Viotti jv@jviotti.com