Workflow instance should be accessible in test environment for simple assertion
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- java
- Ambito
- backend, distributed-systems
Direzione di ricerca
Non vengono indicati file o test. Inizia esaminando l’ambiente di test e l’API testWorkflowClient descritti nell’issue, quindi determina come potrebbe essere esposta un’istanza del workflow con il suo stato più recente senza QueryMethods di produzione. Il lavoro è completato quando un test può recuperare il workflow tramite l’ID del workflow e l’ID dell’esecuzione e verificare il suo stato corrente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Is your feature request related to a problem? Please describe.
I would like to write unit tests on workflow code, and would like to access workflow for assertions in test env.
eg.
class WorkflowImpl implements Workflow {
public String value = "something";
//// more workflow code
}
and the value is updated in the workflow code. I would like to add access the values.
Currently there is no easy way to access the workflow object, as we simply register workflow class as type
Describe the solution you'd like
I would like to access the workflow object at any point in time for test env, and it should provide me an object of workflow with latest state of workflow.
Like
var workflowImpl = (WorkflowImpl) testWorkflowClient.getWorkflowObject("workflowId", "workflowRunId");
assertThat(workflowImpl.value, is("some-assertion-value"));
Describe alternatives you've considered
The other method we have considered is to add a QueryMethod in the workflow but we don't want to add QueryMethod in production code at all.
We can surely do it for tests as well as mentioned at https://temporalio.slack.com/archives/CTT84KXK9/p1747167261307199?thread_ts=1747086843.705119&cid=CTT84KXK9, but it can cause issues when you have multiple variables, and adding QueryMethod for each a lot, and managing QueryMethod for testing can be cumbersome.
Additional context
Discussed this previously at Github - https://temporalio.slack.com/archives/CTT84KXK9/p1747086843705119
- Lingua principale
- Java
- Stelle
- 447
- Fork
- 278
- Merge medio
- 3g 22h
- PR unite (30g)
- 28
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di temporalio/sdk-java
-
Support the certificate with linebreak strings from env variableForse già presa @officialasishkumar l’ha presa 22 giorni fa. Apertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
temporalio/sdk-java#1825 ·
I maintainer di solito rispondono entro 1 giorno
-
Spring Boot drops mainDataConverter when a non-root namespace is configuredForse già presa @yumingjs l’ha presa 1 giorno fa. Apertabug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 74/100
temporalio/sdk-java#3245 ·
I maintainer di solito rispondono entro 1 giorno
-
Spring Boot ignores Ordered on TemporalOptionsCustomizer beansForse già presa @Quinn-With-Two-Ns l’ha presa 2 giorni fa. Apertabug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 30/100
temporalio/sdk-java#3244 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 38/100
temporalio/sdk-java#3238 · 7 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Fix graceful shutdown of the shared worker-command pollerForse già presa @yuandrew l’ha presa 9 giorni fa. Apertasdk-java
temporalio/sdk-java#3234 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di temporalio/sdk-java
Issue simili
-
area-integrations
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
isXander/YetAnotherConfigLib#376 ·
-
? - Needs Triage bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
NVIDIA/cudf-spark-jni#5598 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
oracle/graalvm-reachability-metadata#12264 ·
I maintainer di solito rispondono entro 1 giorno
-
[source-facebook-pages] post stream never returns attachments.media_typeForse già presa @v-k-data l’ha presa oggi. Apertaarea/connectors needs-triage type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 1 giorno