How do you Test API Clients in CI?

Infos:

  • Used Zammad version: 7.0.1
  • Used Zammad installation type: docker-compose
  • Operating system: debian
  • Browser + version: Firefox 149

Expected behavior:

  • I Wanted to have a small Container to bundle into my Woodpecker environment for testing my API Calls against, so that I know that Zammad behaves correctly when I call it

Actual behavior:

  • I Can’t find such a small Container, I don’t wanna test against the live system as I don’t want the system to send out Emails when I do and I Prefer to have a clean system that can reset after my tests, now I set up an entire secondary Zammad just for testing with my object parameter configuration and I can’t get an email configuration that fakes sending, so I doubt I can create fake tickets without such a fake sender-email and I believe I’m far too deep into this rabbit hole, how are you all doing that? do you just not test your API Clients?

Steps to reproduce the behavior:

  • Try to write an API Client and then try to test an API Client without sending emails

For our integrations we usually do webmocking/cassettes. Maybe these 2 keywords help you to find something similar for yourself. So outgoing requests are disabled and can get overwritten with certain results e.g. If somebody makes a request to http://endpoint/route then return status 200 with json body of file result.json.

zammad/spec/lib/external_credential/microsoft_graph_spec.rb at ad5bbf36284feb464551c56cb5c11235cc35cd08 · zammad/zammad · GitHub

zammad/spec/system/import/zendesk_spec.rb at ad5bbf36284feb464551c56cb5c11235cc35cd08 · zammad/zammad · GitHub