Files
temporal/docs
Stephan Behnke 33faf7e12f panic test hooks if not enabled (#8726)
## What changed?

Changed use of `testhooks`'s `Set` to be runtime error instead of
compile time error.

It still ensures that the default impl (used in `go build` artifacts
without `test_dep` tag) is the noop impl.

## Why?

When running a functional test via plain `go test` it will fail, as the
`test_dep` build flag is required. It is required to prevent
accidentally using the default/noop implementation of the `testhooks`
package which allows injecting custom behavior into production code from
tests.

But requiring `test_dep` to run any test adds friction: CLI invocations
need to specify it manually, editor setups need to be adjusted, AI
agents need to be instructed. That's a high price to pay for a test
helper that is used fairly sparsely.

## How did you test it?
- [ ] built
- [x] run locally and tested manually
- [x] covered by existing tests
- [x] added new unit test(s)
- [ ] added new functional test(s)


Functional test without testhook:
```
% go test ./tests -run "OwnershipLostErrorSuite" -count=1 .
ok  	go.temporal.io/server/tests	7.062s
```

Functional test with testhook and build tag:
```
% go test ./tests -run "TestUpdateWorkflowSuite" -tags test_dep -count=1 .
ok  	go.temporal.io/server/tests	36.975s
```

Functional test with testhook but no build tag:
```
% go test ./tests -run "TestUpdateWorkflowSuite" -count=1 .
...
noop_impl.go:39: test panicked: testhooks.Set called but TestHooks are not enabled: use -tags=test_dep when running `go test`
                    goroutine 33293 [running]:
                    runtime/debug.Stack()
...
FAIL
FAIL	go.temporal.io/server/tests	57.128s
FAIL
```
2025-12-09 17:43:36 +00:00
..
2024-05-24 14:25:19 -07:00
2024-03-18 23:13:02 -07:00

Temporal Server Documentation

This folder contains docs for those working closely with the Temporal server. If you are more interested in just authoring workflows, see our Getting Started Guide.

Core Documentation Sections

Architectural Diagrams (/architecture)

This section contains high-level explanations of Temporal's architecture and core concepts. It is designed to be useful for both server developers and those interested in understanding the technological underpinnings of Temporal. Detailed diagrams and descriptions can be found there.

Development Instructions (/development)

Here, you'll find guides to setting up a local development environment, along with potentially more advanced topics such as adding migrations or new Remote Procedure Calls (RPCs). This section is essential for developers looking to contribute to the Temporal codebase or understand its inner workings.

Operational Guides (/admin)

This section provides reference materials for administrators responsible for deploying Temporal in a production environment. It is pretty bare for now, but it is intended to covers topics like spinning up a production environment, configuring it, and monitoring it with metrics and dynamic configurations. For now, you can find this info on the Temporal docs website at https://docs.temporal.io/self-hosted-guide.