~poldi1405/gomod-recter

67fd0cd5e96b383c091f6759d8d7e9cf9719be4a — Moritz Poldrack 2 years ago e147dd8
added automated test
3 files changed, 74 insertions(+), 0 deletions(-)

M Makefile
A contrib/config.toml
A contrib/goss.yml
M Makefile => Makefile +9 -0
@@ 21,5 21,14 @@ push:
	docker push ${IMAGEFULLNAME}
	docker push ${REPO}/${IMAGENAME}:latest

run-goss-test:
	$(MAKE) build
	cp contrib/config.toml config.toml
	./recter &> /dev/null &
	@sleep 1
	goss -g contrib/goss.yml validate -r 30s
	@pkill -9 recter
	@sleep 1

clean:
	rm recter

A contrib/config.toml => contrib/config.toml +33 -0
@@ 0,0 1,33 @@
domain = "my-domain.com"
versionrefreshinterval = "5m0s"

[directories]
  assetdir = "./themes/assets/"
  datadir = "/opt/recter/"
  templatedir = "./themes/very-basic/"

[network]
  listenaddr = "127.0.0.1:25000"
  socketpath = "/tmp/recter.sock"
  type = "tcp"

[projects]

  [projects.example]
    DefaultBranch = "master"
    Description = "The example project is an example that shows how to add a meaningful description to your project.\n\nIf you think that explaining something with itself is a bad way of explaining a thing, feel free to submit a patch. Repetition hammers the point into your head, which is why I repeat everything I say. Having a long text is a plus because long text demonstrates better what happens if you add long text for a description."
    GoSourceFmt = ""
    License = "MIT"
    Redirect = false
    Repo = "https://git.sr.ht/~poldi1405/gomod-recter"
    VCS = "git"
    name = "Example Project"

    [projects.example.Note]
      Show = true
      Style = "warning"
      Text = "This project is currently looking for a new maintainer. To apply, please reach out to me@my-domain.com"

[proxy]
  address = "https://proxy.golang.org/"
  ignorecert = false

A contrib/goss.yml => contrib/goss.yml +32 -0
@@ 0,0 1,32 @@
http:
  http://127.0.0.1:25000/:
    status: 200
    no-follow-redirects: true
    timeout: 5000
    body: ["/example", "Example Project"]
  http://127.0.0.1:25000/example:
    status: 200
    no-follow-redirects: true
    timeout: 5000
    body: ["me@my-domain.com", "Hosted with recter"]
  http://127.0.0.1:25000/example?go-get=1:
    status: 200
    no-follow-redirects: false
    timeout: 5000
    body:
    - my-domain.com/example git https://git.sr.ht/~poldi1405/gomod-recter
    - https://git.sr.ht/~poldi1405/gomod-recter/tree/master{/dir}
  http://127.0.0.1:25000/not-found:
    status: 303
    no-follow-redirects: true
    timeout: 5000
    headers:
    - 'Location: http://127.0.0.1:25000/'
  http://127.0.0.1:25000/not-found?go-get=1:
    status: 404
    allow-insecure: false
    timeout: 5000
  http://127.0.0.1:25000/not-found:
    status: 200
    timeout: 5000
    body: ["/example", "Example Project"]