Unverified Commit 98135ce1 authored by emilylange's avatar emilylange
Browse files

forgejo: fix `checkPhase` regression

This fixes a regression introduced in 5de92a8b.

Forgejo v13 made the GO_TEST_PACKAGES variable lazy in [1], which causes
our custom show-backend-tests make target to return an empty string,
which in turn causes our checkPhase to not run a single go test.

To fix this, we need to slightly modify our custom make target to
reference the newly introduced compute-go-test-packages target as a
dependency.

[1]: https://codeberg.org/forgejo/forgejo/pulls/9208
parent c3fb98e8
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -105,11 +105,12 @@ buildGoModule rec {
    export ldflags+=" -X main.ForgejoVersion=$(GITEA_VERSION=${version} make show-version-api)"
  '';

  preCheck = ''
  # expose and use the GO_TEST_PACKAGES var from the Makefile
  # instead of manually copying over the entire list:
    # https://codeberg.org/forgejo/forgejo/src/tag/v7.0.4/Makefile#L124
    echo -e 'show-backend-tests:\n\t@echo ''${GO_TEST_PACKAGES}' >> Makefile
  # https://codeberg.org/forgejo/forgejo/src/tag/v11.0.6/Makefile#L128
  # https://codeberg.org/forgejo/forgejo/src/tag/v13.0.0/Makefile#L290
  preCheck = ''
    echo -e 'show-backend-tests:${lib.optionalString (lib.versionAtLeast version "13") " | compute-go-test-packages"}\n\t@echo ''${GO_TEST_PACKAGES}' >> Makefile
    getGoDirs() {
      make show-backend-tests
    }