cloverage

fabrao 2022-01-12T15:06:18.017400Z

Sorry @lee late response, I want to change the messag in Clojure CI / cloverage (pull_request) Successful in 4m to Clojure CI / cloverage (pull_request) Testing coverage is 80% , do you think is that possible?

lread 2022-01-12T16:00:56.020500Z

@fabrao Oh I see. You want to see a summary of % coverage without digging into the workflow output. http://Codecov.io kinda sorta does this. I personally did not like this behaviour and disabled it, but by default it will add a comment to your PR. Here's https://github.com/lambdaisland/kaocha/pull/265#issuecomment-1010305140.

fabrao 2022-01-12T16:03:47.022200Z

Ho, that´s nice, but I want something more simple, just a message. But I think it´s more like github integration stuff, thank you

lread 2022-01-12T16:06:57.024600Z

Yeah, I hear ya, might be possible, but I also would not be surprised if GitHub would want to keep that top-level summary message standard/fixed. Let us know if you find a way!

fabrao 2022-01-12T16:11:33.026Z

I could use in other way, but could not in the same line as the checking, that I want to do. But it solve the issue in anyway.

lread 2022-01-12T16:13:37.027Z

Congrats! Is your project open source, can you share details on how you achieved this?

fabrao 2022-01-12T16:21:50.028200Z

the project is private but I can share the way we did it for github action:

# Run tests
      - name: Run Coverage Tests
        run: clojure -M:cloverage > /tmp/cloverage.txt

      - name: Generate covarege Status
        run: |
          set -x
          total=`cat /tmp/cloverage.txt | grep "ALL FILES" | grep -Eo '[0-9]+\.[0-9]+' | head -1`
          echo "total coverage: $total"
          curl "https://${{ github.actor }}:${{ github.token }}@api.github.com/repos/${COMPANY}/${PROJECT}/statuses/${COMMIT_SHA}" -d "{\"state\": \"success\",\"target_url\": \"\",\"description\": \"${total}%\",\"context\": \"Resultado cobertura dos testes\"}"
        env:
		  COMPANY: "company_name"
		  PROJECT: "project_name"
          COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
          PULL_NUMBER: ${{ github.event.pull_request.number }}
          RUN_ID: ${{ github.run_id }}
deps.edn:

fabrao 2022-01-12T16:22:07.028500Z

:cloverage
  {:extra-paths ["test"]
   :extra-deps {cloverage/cloverage {:mvn/version "1.2.2"}
                babashka/process {:mvn/version "0.0.2"}
                spec-provider/spec-provider {:mvn/version "0.4.14"}}
   :main-opts ["-m" "cloverage.coverage"
               "--no-html"
               "-p" "src"
               "-s" "test"
               "--no-colorize"
               "-t" "^(?!.*?(?:live|integration)).*$"
               "--fail-threshold" "30"]}

lread 2022-01-12T20:00:29.028900Z

Interesting @fabrao, thank you for sharing!