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

ci: update test workflow #1449

Merged
merged 2 commits into from
Nov 27, 2023
Merged

ci: update test workflow #1449

merged 2 commits into from
Nov 27, 2023

Conversation

mpoke
Copy link
Contributor

@mpoke mpoke commented Nov 27, 2023

Description

Closes: #908

Separate test workflow.


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • Included the correct type prefix in the PR title
  • Targeted the correct branch (see PR Targeting)
  • Provided a link to the relevant issue or specification
  • Reviewed "Files changed" and left comments if necessary
  • Confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • Confirmed the correct type prefix in the PR title
  • Confirmed all author checklist items have been addressed
  • Confirmed that this PR does not change production code

@mpoke mpoke requested a review from a team as a code owner November 27, 2023 14:03
@github-actions github-actions bot added C:Build Assigned automatically by the PR labeler C:CI Assigned automatically by the PR labeler labels Nov 27, 2023
Copy link
Contributor

@MSalopek MSalopek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@p-offtermatt p-offtermatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, this looks much more sensible now.
Just a comment about SonarCloud.

go-version: "1.20" # The Go version to download (if necessary) and use.
- name: Test with coverage
run: go test -coverpkg=./x/... -coverprofile=coverage.out ./...
- name: SonarCloud Scan
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we not still have the Sonar Cloud scan? I don't see this in the workflow outputs anymore

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@p-offtermatt p-offtermatt Nov 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are not the same thing afaict, see the details page for the SonarCloud job:
https://github.com/cosmos/interchain-security/pull/1443/checks?check_run_id=19046483938
https://github.com/cosmos/interchain-security/pull/1339/checks?check_run_id=19055224418
vs the details page of the repo analysis job
https://github.com/cosmos/interchain-security/actions/runs/7006381975/job/19058262889?pr=1449

the repo analysis job gives no useful info, or at least I can't see where to access it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The difference is the if condition if: ${{ env.GIT_DIFF }}, i.e.,

      # before
      - name: SonarCloud Scan
        uses: SonarSource/sonarcloud-github-action@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
        if: env.SONAR_TOKEN != null
     # now
     - name: sonarcloud
        if: ${{ env.GIT_DIFF && !github.event.pull_request.draft }}
        uses: SonarSource/sonarcloud-github-action@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

If you look at https://github.com/cosmos/interchain-security/actions/runs/7006381975/job/19058262889?pr=1449, you'll see that sonarcloud is not executed. That's because of the following lines

     - uses: technote-space/[email protected]
        id: git_diff
        with:
          PATTERNS: |
            **/*.go
            go.mod
            go.sum
            **/go.mod
            **/go.sum

Copy link
Contributor

@p-offtermatt p-offtermatt Nov 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does something else stop it from running here? https://github.com/cosmos/interchain-security/actions/runs/7008218190/job/19064178033?pr=1456
I am changing lines in a .go file, and afaict it is also not excluded in the sonarcloud properties

NOTE: I think the job was started with the PR in draft mode, so I'm rerunning it just to make sure it's not that

Also doesn't run after restarting it in non-draft mode, I can't quite tell why it doesn't run. But we will have real PRs with the new workflow to confirm that it still works as expected soon enough, so no bother looking more at this right now I think

@mpoke mpoke merged commit 2a8a3d4 into main Nov 27, 2023
14 checks passed
@mpoke mpoke deleted the marius/908-testing-ci branch November 27, 2023 16:40
MSalopek pushed a commit that referenced this pull request Dec 1, 2023
* update test workflow

* rename Gosec job to avoid conflict
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:Build Assigned automatically by the PR labeler C:CI Assigned automatically by the PR labeler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ease of use: Remove unit tests from automated-tests
3 participants