fediverse-devnet / feditest

A testing framework for distributed, heterogeneous systems communicating with complex protocols, such as the Fediverse
https://feditest.org/
MIT License
31 stars 6 forks source link

TypeError in running sandbox tests #299

Closed jernst closed 1 month ago

jernst commented 1 month ago

This is feditest develop against feditest-tests-sandbox with #15.

cd feditest-tests-sandbox make -f Makefile.create FEDITEST=../feditest/venv.linux.develop/bin/feditest make -f Makefile.run FEDITEST=../feditest/venv.linux.develop/bin/feditest

stops with error. The JSON test transcript that is being converted examples/testresults/sandbox-all-clientA-vs-server1.json (see #298) contains this result fragment:

    "sessions": [
        {
            "plan_session_index": 0,
            "started": "2024-08-06T20:13:26.478716Z",
            "ended": "2024-08-06T20:13:26.487753Z",
            "constellation": {
                "nodes": {
                    "client": {
                        "appdata": {
                            "app": "SandboxMultClient_ImplementationA",
                            "app_version": "0.3"
                        }
                    },
                    "server": {
                        "appdata": {
                            "app": "SandboxMultServer_Implementation1",
                            "app_version": "0.3"
                        }
                    }
                }
            },
            "run_tests": [],
            "result": {
                "type": "TypeError",
                "spec_level": "UNSPECIFIED",
                "interop_level": "UNKNOWN",
                "stacktrace": [],
                "msg": "write() argument must be str, not None"
            }
        }
    ],

With console output:

../feditest/venv.linux.develop/bin/feditest run \
    --testplan examples/testplans/sandbox-all-clientA-vs-server1.json \
    --json examples/testresults/sandbox-all-clientA-vs-server1.json \
|| echo 'ERRORS in the test run (as expected), so we continue'
2024-08-06T13:30:20Z [ERROR] feditest: Ended TestRunSession clientA vs server1 with Exception:
Traceback (most recent call last):
  File "/home/ubosdev/git/github.com/jernst/feditest/venv.linux.develop/lib/python3.11/site-packages/feditest/testrun.py", line 344, in run
    self.run_constellation.setup()
  File "/home/ubosdev/git/github.com/jernst/feditest/venv.linux.develop/lib/python3.11/site-packages/feditest/testrun.py", line 101, in setup
    registry.add_to_system_trust_root(root_cert)
  File "/home/ubosdev/git/github.com/jernst/feditest/venv.linux.develop/lib/python3.11/site-packages/feditest/registry.py", line 226, in add_to_system_trust_root
    f.write(root_cert)
TypeError: write() argument must be str, not None