-
Notifications
You must be signed in to change notification settings - Fork 154
Description
We have a collection tests that validate git-proxy internals but nothing which runs in CI that validates changes acting as a client integrating with the git-proxy server(s). Tests should be run (at least on main or pre-release) to validate the server's behaviour end-to-end using a tool like serverspec or goss.
Another option would be a simple Docker-based test (package the app, run a container, run an HTTP-based test through it and shut down the container). container-structure-test is an option there. The below is an illustrative example - it's not a working test but should give an implementer a starting point.
schemaVersion: '2.0.0'
commandTests:
- name: 'verify git-proxy returns 200'
setup:
- ["npm", "install", "axios"]
- ["npx", "--", "@finos/git-proxy"]
command: 'node'
args:
- -e
- |
const axios = require("axios");
axios.get("http://localhost:8080/api/v1/health")
.then(function (response) {
console.log(response.status);
});
expectedOutput: ["200"]
exitCode: 0Yup but I don't mean in a spec runner like jest or mocha where you have to manipulate the require cache.
It may be possible to setup jobs that simulate how the end user would test it in CI and just provide the env vars there to confirm by pinging the running services.
Originally posted by @lwhiteley in #379 (comment)