Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

e2e testing of git-proxy #394

Open
coopernetes opened this issue Jan 11, 2024 · 5 comments
Open

e2e testing of git-proxy #394

coopernetes opened this issue Jan 11, 2024 · 5 comments
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@coopernetes
Copy link
Contributor

coopernetes commented Jan 11, 2024

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: 0

Yup 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)

@JamieSlome JamieSlome added help wanted Extra attention is needed good first issue Good for newcomers labels Jan 12, 2024
@marksmith388
Copy link

Hi, does this issue need to be looked at?

@JamieSlome
Copy link
Member

@marksmith388 - for sure! Wanna tackle it? 😇

@marksmith388
Copy link

Absolutely!

@marksmith388
Copy link

I have a working solution using goss, what are my next steps?

@JamieSlome
Copy link
Member

@marksmith388 - thanks for joining the community call today and apologies for missing your message from last week 🤗

@coopernetes - can we define a number of test requirements for this ticket to make sure @marksmith388 has something clear to work towards?

Of course appreciate you said you would both follow up on Slack but posting here to serve more as a small reminder in any case 💡

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants