Is there any known issue for unit testing the Kube...
# kubernetes
v
Is there any known issue for unit testing the Kubernetes yaml ConfigFile?
Copy code
Failed to import test module: test_grafana_agent
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/loader.py", line 407, in _find_test_path
    module = self._get_module_from_name(name)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/loader.py", line 350, in _get_module_from_name
    __import__(name)
  File "/Users/achernar/workspace/iconik-io/pulumi-k8s-iconik/tests/test_grafana_agent.py", line 14, in <module>
    class TestingGrafanaAgentWithMocks(TestCase):
  File "/Users/achernar/workspace/iconik-io/pulumi-k8s-iconik/tests/test_grafana_agent.py", line 44, in TestingGrafanaAgentWithMocks
    grafana_agent = icnk.GrafanaAgent(
                    ^^^^^^^^^^^^^^^^^^
  File "/Users/achernar/workspace/iconik-io/pulumi-k8s-iconik/pulumi_k8s_iconik/grafana_agent.py", line 128, in __init__
    grafana_agent = k8s.yaml.ConfigFile(
                    ^^^^^^^^^^^^^^^^^^^^
  File "/Users/achernar/workspace/iconik-io/pulumi-k8s-iconik/.venv/lib/python3.11/site-packages/pulumi_kubernetes/yaml/yaml.py", line 352, in __init__
    __ret__ = invoke_yaml_decode(text, invoke_opts)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/achernar/workspace/iconik-io/pulumi-k8s-iconik/.venv/lib/python3.11/site-packages/pulumi_kubernetes/yaml/yaml.py", line 1931, in invoke_yaml_decode
    inv = pulumi.runtime.invoke('kubernetes:yaml:decode', {'text': text}, invoke_opts)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/achernar/workspace/iconik-io/pulumi-k8s-iconik/.venv/lib/python3.11/site-packages/pulumi/runtime/invoke.py", line 141, in invoke
    invoke_result, invoke_error = _sync_await(asyncio.ensure_future(do_rpc()))
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/achernar/workspace/iconik-io/pulumi-k8s-iconik/.venv/lib/python3.11/site-packages/pulumi/runtime/sync_await.py", line 56, in _sync_await
    return loop.run_until_complete(fut)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/Users/achernar/workspace/iconik-io/pulumi-k8s-iconik/.venv/lib/python3.11/site-packages/pulumi/runtime/invoke.py", line 136, in do_rpc
    raise exn
  File "/Users/achernar/workspace/iconik-io/pulumi-k8s-iconik/.venv/lib/python3.11/site-packages/pulumi/runtime/rpc_manager.py", line 71, in rpc_wrapper
    result = await rpc
             ^^^^^^^^^
  File "/Users/achernar/workspace/iconik-io/pulumi-k8s-iconik/.venv/lib/python3.11/site-packages/pulumi/runtime/invoke.py", line 106, in do_invoke
    resp, error = await asyncio.get_event_loop().run_in_executor(None, do_invoke)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/achernar/workspace/iconik-io/pulumi-k8s-iconik/.venv/lib/python3.11/site-packages/pulumi/runtime/invoke.py", line 102, in do_invoke
    return monitor.Invoke(req), None
           ^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'Invoke'
My system is failing during test discovery on a test file that is using
pulumi_kubernetes.yaml.ConfigFile