Comments (1)
Yes, the client is not available in the test environment. That may be why the activity is mocked. This is a common unit test approach to test just the workflow as a unit and not the activity.
Making TestWorkflowEnvironment
implement the whole of client.Client
may be unreasonable for a test environment, especially since there is no server to talk to. Rather, a https://pkg.go.dev/go.temporal.io/sdk/mocks#Client should be used to simulate client activity (and should be passed as the context value if that value were ever used).
In this particular test case, it makes no sense for us to set that context value that is never used from the test case, so I can remove it.
from samples-go.
Related Issues (20)
- go.temporal.io/sdk/contrib/tools/workflowcheck-v0.0.0-20230413153418-eaa3802876de: 3 vulnerabilities (highest severity is: 6.1) - autoclosed HOT 1
- Update sample should early exit if update is not enabled and provide instruction to enable. HOT 1
- [Feature Request] Add a sample with opentelemetry tracing HOT 9
- [Bug] DevContainer doesn't start the temporal server image HOT 3
- Go Worker versioning samples
- go.temporal.io/sdk/contrib/tools/workflowcheck-v0.0.0-20230612164027-11c2cb9e7d2d: 3 vulnerabilities (highest severity is: 6.1) - autoclosed HOT 1
- [Bug] serverjwtauth sample doesn't work with newer servers
- CreateSession doesn't work. HOT 2
- [Bug] devcontainer usage HOT 2
- [Bug] reqrespactivity/reqrespquery samples have wrong assumpion about Selector.HasPending
- Add Sample for Typed equivalents for workflow.* functions/interfaces using generics HOT 1
- Sample request: Rate limiting or semaphore implemented as a workflow
- [Feature Request] Temporal server release with otel upgrade HOT 1
- [Feature Request] Sentry sample
- [Feature Request] Add Eager Workflow Start sample
- [Feature Request] In metrics/prometheus sample, demonstrate millisecond histograms
- [Feature Request] Sample Update: Robust session retries HOT 2
- Allow users to switch between cloud and localhost when running samples
- Failed status HOT 2
- add real time app sample
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from samples-go.