Skip to content

Gradle tests are failing #293

@lread

Description

@lread

Context

I run antq against rewrite-clj master to make sure I've not broken antq with a rewrite-clj change.

Problem

I noticed that antq tests are failing.
So I retried them in my of antq and witnessed the same failure on CI:

FAIL in antq.dep.gradle-test/extract-deps-without-repositories-test (gradle_test.clj:47)
expected: (seq actual-deps)
  actual: (not (seq #{}))
╭───── Test output ───────────────────────────────────────────────────────
│ Failed to run gradle
╰─────────────────────────────────────────────────────────────────────────

FAIL in antq.dep.gradle-test/extract-deps-without-repositories-test (gradle_test.clj:48)
expected: (every? (fn* [p1__33432#] (contains? actual-deps p1__33432#)) defined-deps)
  actual: (not (every? #object[antq.dep.gradle_test$fn__33433$fn__33440 0x36935e16 "antq.dep.gradle_test$fn__33433$fn__33440@36935e16"] #{#antq.record.Dependency{:type :java, :file "path/to/build.gradle", :name "org.clojure/tools.namespace", :version "1.0.0", :latest-version nil, :repositories nil, :project :gradle, :changes-url nil, :latest-name nil, :only-newest-version? nil, :exclude-versions nil, :parent nil} #antq.record.Dependency{:type :java, :file "path/to/build.gradle", :name "org.ajoberstar/jovial", :version "0.3.0", :latest-version nil, :repositories nil, :project :gradle, :changes-url nil, :latest-name nil, :only-newest-version? nil, :exclude-versions nil, :parent nil} #antq.record.Dependency{:type :java, :file "path/to/build.gradle", :name "org.clojure/clojure", :version "1.10.0", :latest-version nil, :repositories nil, :project :gradle, :changes-url nil, :latest-name nil, :only-newest-version? nil, :exclude-versions nil, :parent nil}}))
╭───── Test output ───────────────────────────────────────────────────────
│ Failed to run gradle
╰─────────────────────────────────────────────────────────────────────────
152 tests, 527 assertions, 2 failures.
make: *** [Makefile:11: test] Error 2
Error: Process completed with exit code 2.

What's changed?

The Github Action Runner upgrade gradle to version 9.0.0

Diagnosis

Test cmd:

clojure -M:dev:test --focus antq.dep.gradle-test

If I try locally with gradle v9.0.0 I can reproduce the above:

--- unit (clojure.test) ---------------------------
antq.dep.gradle-test
  extract-deps-without-repositories-test FAIL FAIL
  extract-deps-command-error-test
  extract-deps-test

Randomized with --seed 1467944436

FAIL in antq.dep.gradle-test/extract-deps-without-repositories-test (gradle_test.clj:47)
expected: (seq actual-deps)
  actual: (not (seq #{}))
╭───── Test output ───────────────────────────────────────────────────────
│ Failed to run gradle
╰─────────────────────────────────────────────────────────────────────────

FAIL in antq.dep.gradle-test/extract-deps-without-repositories-test (gradle_test.clj:48)
expected: (every? (fn* [p1__33279#] (contains? actual-deps p1__33279#)) defined-deps)
  actual: (not (every? #object[antq.dep.gradle_test$fn__33280$fn__33287 0x5a829eed "antq.dep.gradle_test$fn__33280$fn__33287@5a829eed"] #{#antq.record.Dependency{:type :java, :file "path/to/build.gradle", :name "org.clojure/tools.namespace", :version "1.0.0", :latest-version nil, :repositories nil, :project :gradle, :changes-url nil, :latest-name nil, :only-newest-version? nil, :exclude-versions nil, :parent nil} #antq.record.Dependency{:type :java, :file "path/to/build.gradle", :name "org.ajoberstar/jovial", :version "0.3.0", :latest-version nil, :repositories nil, :project :gradle, :changes-url nil, :latest-name nil, :only-newest-version? nil, :exclude-versions nil, :parent nil} #antq.record.Dependency{:type :java, :file "path/to/build.gradle", :name "org.clojure/clojure", :version "1.10.0", :latest-version nil, :repositories nil, :project :gradle, :changes-url nil, :latest-name nil, :only-newest-version? nil, :exclude-versions nil, :parent nil}}))
╭───── Test output ───────────────────────────────────────────────────────
│ Failed to run gradle
╰─────────────────────────────────────────────────────────────────────────
3 tests, 4 assertions, 2 failures.

If I downgrade to gradle v8.14.3 the test passes:

--- unit (clojure.test) ---------------------------
antq.dep.gradle-test
  extract-deps-without-repositories-test
  extract-deps-test
  extract-deps-command-error-test

3 tests, 4 assertions, 0 failures.

Work around

Downgrade to Gradle 8.14.3. For CI this can be accomplished via the setup-gradle action:

      - name: Install Gradle
        uses: gradle/actions/setup-gradle@v4
        with:
          gradle-version: '8.14.3'

Notes

Gradle 9 requires a min of jdk17, so after a real fix is in, will have to adapt tests to only run on jdk17+.

Next Steps

I am not very familiar with gradle, but if you need a hand, I am here to help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions