1+ //go:build integration
2+
13package test
24
35import (
@@ -14,7 +16,10 @@ import (
1416)
1517
1618func TestWorkflow (t * testing.T ) {
17- t .Skip ()
19+ key := os .Getenv ("UNSTRUCTURED_API_KEY" )
20+ if key == "" {
21+ t .Skip ("skipping because UNSTRUCTURED_API_KEY is not set" )
22+ }
1823
1924 pretty := func (v any ) string {
2025 data , err := json .MarshalIndent (v , "" , " " )
@@ -26,13 +31,7 @@ func TestWorkflow(t *testing.T) {
2631 }
2732
2833 client , err := unstructured .New (
29- // unstructured.WithClient(&http.Client{
30- // Transport: &teert{
31- // next: http.DefaultTransport,
32- // dst: t.Output(),
33- // },
34- // }),
35- unstructured .WithKey (os .Getenv ("UNSTRUCTURED_API_KEY" )),
34+ unstructured .WithKey (key ),
3635 )
3736 if err != nil {
3837 t .Fatalf ("failed to create client: %v" , err )
@@ -57,7 +56,7 @@ func TestWorkflow(t *testing.T) {
5756
5857 t .Cleanup (func () { _ = client .DeleteWorkflow (ctx , workflow .ID ) })
5958
60- // get all the dir under ./testdata and use them in a call to run the workflow.
59+ // get all the files under ./testdata and use them in a call to run the workflow.
6160 dir , err := os .ReadDir ("testdata" )
6261 if err != nil {
6362 t .Fatalf ("failed to read testdata: %v" , err )
0 commit comments