ww: report no test files for empty test packages
This commit is contained in:
@@ -3180,7 +3180,7 @@ still checked; that is a real zero-test package and runs one empty combined
|
||||
harness. A directory with no selected test files instead follows the no-real-run
|
||||
path: validate/compile ordinary production as needed, publish status only, and
|
||||
create no support action, generated main, link, binary, result, or process. The
|
||||
coordinator alone emits its `[no tests]` report.
|
||||
coordinator alone emits its `[no test files]` report.
|
||||
|
||||
Persistent workdirs keep a global driver/compiler/assembler/stamp identity and
|
||||
per-action committed units. When that global identity is stale, the command
|
||||
@@ -5593,12 +5593,14 @@ precise body/export and target-removal/re-addition invalidation, combined-graph
|
||||
allocation failure, repeated late internal/external/main/link rollback, and a
|
||||
complete work-directory sweep for staged residue.
|
||||
|
||||
Deliberately unchanged or unsupported behavior includes the raw single-file
|
||||
compatibility path, WW's `[no tests]` presentation text, Go modules and build
|
||||
cache, network resolution, manifests, coverage/vet/fuzz/benchmark generation,
|
||||
source-level build expressions, quoted/grouped/dot imports, and targets other
|
||||
than the separately specified fixed `linux/amd64` filename selection. None is
|
||||
used to define canonical package or directory-product identity.
|
||||
At completion of this earlier topology slice, deliberately unchanged or
|
||||
unsupported behavior included the raw single-file compatibility path, the
|
||||
then-current `[no tests]` presentation text, Go modules and build cache, network
|
||||
resolution, manifests, coverage/vet/fuzz/benchmark generation, source-level
|
||||
build expressions, quoted/grouped/dot imports, and targets other than the
|
||||
separately specified fixed `linux/amd64` filename selection. Section 11.35
|
||||
subsequently closes only that presentation-text gap. None is used to define
|
||||
canonical package or directory-product identity.
|
||||
|
||||
### 11.23 Implemented case-fold collision preflight
|
||||
|
||||
@@ -6271,9 +6273,9 @@ selected package; missing parents are created with `0777` subject to umask. A
|
||||
non-directory destination accepts exactly one selected package. Exact
|
||||
`/dev/null` suppresses retained copies, permits duplicate visible names, and
|
||||
does not suppress execution unless `-c` is also present. A no-test package
|
||||
performs ordinary production validation, reports `[no tests]`, and creates no
|
||||
binary or otherwise-unused output directory. Successful compile-only products
|
||||
are silent, matching Go's no-op print action.
|
||||
performs ordinary production validation, reports `[no test files]`, and creates
|
||||
no binary or otherwise-unused output directory. Successful test-bearing
|
||||
compile-only products are silent, matching Go's no-op print action.
|
||||
|
||||
For `-c`, the driver copies the private runnable bytes to a distinct `.new`
|
||||
inode opened with executable mode `0777` subject to umask. Temporary runnable,
|
||||
@@ -7343,6 +7345,127 @@ Existing directory execution observers cover signals, timeouts, child cleanup,
|
||||
and canonical-order behavior with the new final line, while build-mode controls
|
||||
prove that the other command axis remains silent.
|
||||
|
||||
### 11.35 Implemented Go-like no-test-files package result
|
||||
|
||||
A source-bearing directory test product with no selected `*_test.ww` file now
|
||||
reports exactly `? <package> [no test files]\n` after ordinary production
|
||||
validation. It continues to create no test-support action, generated main,
|
||||
link, runnable, retained binary, captured runtime result, or process. The rule
|
||||
is shared by explicit directories, implicit current-directory selection,
|
||||
logical/dotted targets, recursive discovery, and compile-only or retained-output
|
||||
requests. Platform-ineligible test filenames do not prevent the result. A
|
||||
selected helper-only test file remains a real test product with an empty
|
||||
harness; the raw single-file compatibility route remains outside the
|
||||
directory-owned selected-test-file classification.
|
||||
|
||||
#### Pinned Go evidence and fact classification
|
||||
|
||||
The sole authority is official Go 1.26.5 at commit
|
||||
`c19862e5f8415b4f24b189d065ed739517c548ba`:
|
||||
|
||||
- `builderTest` detects
|
||||
`len(p.TestGoFiles)+len(p.XTestGoFiles) == 0`, keeps ordinary production as a
|
||||
dependency, constructs output-preparation and print actions, and creates no
|
||||
real test binary or run action
|
||||
([`cmd/go/internal/test/test.go`, lines 1133–1169](https://github.com/golang/go/blob/c19862e5f8415b4f24b189d065ed739517c548ba/src/cmd/go/internal/test/test.go#L1133-L1169)).
|
||||
- `(*runTestActor).Act` owns that print action and writes exactly
|
||||
`? \t%s\t[no test files]\n` in the ordinary non-coverage case
|
||||
([`cmd/go/internal/test/test.go`, lines 1524–1557, especially 1551–1552](https://github.com/golang/go/blob/c19862e5f8415b4f24b189d065ed739517c548ba/src/cmd/go/internal/test/test.go#L1524-L1557)).
|
||||
- Official `test_no_tests.txt` invokes `go test testnorun`, requires the
|
||||
`[no test files]` result, and gives production an initializer that panics if a
|
||||
test binary is linked and executed
|
||||
([`cmd/go/testdata/script/test_no_tests.txt`, lines 1–14](https://github.com/golang/go/blob/c19862e5f8415b4f24b189d065ed739517c548ba/src/cmd/go/testdata/script/test_no_tests.txt#L1-L14)).
|
||||
|
||||
Those source rules and the script expectation are behavior directly implemented
|
||||
or asserted by pinned Go. That the ordinary case compiles production, prints the
|
||||
package result, and does not execute initialization is behavior derived from the
|
||||
pinned action graph. Applying the bracketed status to WW's established local
|
||||
package presentation is likewise derived: WW has no module import path, but its
|
||||
directory product already owns the corresponding selected-test-file decision
|
||||
and no-process action branch. This does not import Go's coverage behavior,
|
||||
module loader, cache, manifest, registry, or network resolution.
|
||||
|
||||
#### Fresh four-axis audit and direct pre-fix measurements
|
||||
|
||||
The bounded audit considered all four permanent axes and selected only this
|
||||
test-result wording gap:
|
||||
|
||||
- **Go-like build:** pinned unresolved-symbol handling and its special missing
|
||||
`main` case are implemented by `(*ErrorReporter).errorUnresolved`
|
||||
([`cmd/link/internal/ld/errors.go`, lines 29–67](https://github.com/golang/go/blob/c19862e5f8415b4f24b189d065ed739517c548ba/src/cmd/link/internal/ld/errors.go#L29-L67))
|
||||
and asserted by `TestUndefinedRelocErrors`
|
||||
([`cmd/link/internal/ld/ld_test.go`, lines 19–45](https://github.com/golang/go/blob/c19862e5f8415b4f24b189d065ed739517c548ba/src/cmd/link/internal/ld/ld_test.go#L19-L45))
|
||||
using `issue10978/main.go`
|
||||
([lines 5–27](https://github.com/golang/go/blob/c19862e5f8415b4f24b189d065ed739517c548ba/src/cmd/link/internal/ld/testdata/issue10978/main.go#L5-L27)).
|
||||
Both WW stages rejected a selected `package main` without `fn main`, emitted
|
||||
identical 50-byte linker diagnostics, and created no output. This candidate
|
||||
was aligned.
|
||||
- **Go-like test:** a production directory with an aborting initializer and no
|
||||
test file made both stages exit 0 with empty stderr and byte-identical 55-byte
|
||||
stdout (SHA-256
|
||||
`36adf30792e2900b60ec8cd02ba86e0387acebd41c4d9aab186af2c649ffe67c`):
|
||||
`? /tmp/ww-go1265-four-axis.Wq8d8H/notest [no tests]\n`.
|
||||
Bare implicit, logical `-I`, and `-c` forms produced the same bytes; `-c`
|
||||
created no binary. A platform-excluded test file produced the same old status
|
||||
class without observing its missing import or test body. These are directly
|
||||
measured pre-fix WW facts and establish the selected external difference.
|
||||
- **Go-like package:** `MultiplePackageError` and the package scan reject
|
||||
conflicting selected declarations
|
||||
([`go/build/build.go`, lines 538–548 and 931–967](https://github.com/golang/go/blob/c19862e5f8415b4f24b189d065ed739517c548ba/src/go/build/build.go#L538-L548));
|
||||
`TestMultiplePackageImport` asserts the file/name pairs
|
||||
([`go/build/build_test.go`, lines 105–133](https://github.com/golang/go/blob/c19862e5f8415b4f24b189d065ed739517c548ba/src/go/build/build_test.go#L105-L133)).
|
||||
Both WW stages rejected an `alpha`/`beta` production directory identically
|
||||
before tools. This candidate was aligned.
|
||||
- **Go-like import:** `unusedImports` and `errorUnusedPkg` implement unused
|
||||
ordinary and renamed-import diagnostics
|
||||
([`cmd/compile/internal/types2/resolver.go`, lines 706–740](https://github.com/golang/go/blob/c19862e5f8415b4f24b189d065ed739517c548ba/src/cmd/compile/internal/types2/resolver.go#L706-L740));
|
||||
official `importdecl0` asserts both forms
|
||||
([`internal/types/testdata/check/importdecl0/importdecl0a.go`, lines 9–27](https://github.com/golang/go/blob/c19862e5f8415b4f24b189d065ed739517c548ba/src/internal/types/testdata/check/importdecl0/importdecl0a.go#L9-L27)).
|
||||
After normalizing only PID-bearing scratch roots, both WW stages rejected an
|
||||
unused renamed dotted import with the same diagnostic and no output. This
|
||||
candidate was aligned.
|
||||
|
||||
The command observations in that list are directly measured WW behavior. The
|
||||
linked source and testdata are behavior directly implemented or asserted by
|
||||
pinned Go. Selecting only the no-test-files presentation while keeping build,
|
||||
package, and import semantics fixed is behavior derived from the pinned action
|
||||
boundary and WW's already aligned no-process topology.
|
||||
|
||||
#### Ownership, final behavior, and preserved boundaries
|
||||
|
||||
`internal/wwpackage.pkgemitgroup` is the sole semantic owner of the directory
|
||||
package result. The loader still sets `g.notests` only after exact filename and
|
||||
platform eligibility have selected the source set. Product construction still
|
||||
compiles ordinary production and omits support/main/link/output/status actions;
|
||||
the scheduler still skips execution. The successful result literal changes
|
||||
only after that work succeeds. Loading, import, package, graph, compiler,
|
||||
assembler, archiver, linker, or publication failure therefore retains its prior
|
||||
diagnostic and precedence and cannot be hidden by a no-test-files result.
|
||||
|
||||
Canonical dotted package/import identity, declared names, file-local import
|
||||
bindings, graph nodes and edges, action keys, physical-directory metadata,
|
||||
symbols, `.wwi`, source units, assembly, objects, archives, and executable bytes
|
||||
are unchanged. There is no new artifact or publication destination. `-c` and
|
||||
`-o` still omit a binary and do not create an otherwise-unused output hierarchy;
|
||||
prior caller state and persistent generations are preserved on every producer
|
||||
failure. Warm reuse and invalidation still concern production actions only.
|
||||
|
||||
Concurrent products retain canonical ordered emission because the text remains
|
||||
inside the existing group emitter. Interruption before emission makes no new
|
||||
promise; the branch starts no child that can be signalled or timed out. Cleanup
|
||||
still removes only request-private plan state, creates no `.new` or `.install`
|
||||
stage, and leaves no test-process residue. Cstage and WWstage use the same
|
||||
coordinator owner and therefore emit byte-identical diagnostics and results.
|
||||
|
||||
The WW-native `empty_and_invalid_package_classes` observer now requires the
|
||||
exact explicit and implicit result in both stages and uses an aborting production
|
||||
initializer to prove no process starts. Existing package observers cover
|
||||
logical and recursive selection, platform filtering, helper-only selected test
|
||||
files, compile-only/output omission, persistent cold/warm/invalidation behavior,
|
||||
large scheduling sets, failure rollback, stage parity, and artifact-byte
|
||||
identity. No persisted-byte contract changed: build workdir format remains
|
||||
`18`, test workdir format remains `19`, and semantic storage format remains `3`.
|
||||
|
||||
## 12. Candidate architectures and hard-gate decision
|
||||
|
||||
Five candidates were developed as coherent systems, not as feature bins.
|
||||
|
||||
Reference in New Issue
Block a user