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 checkstyle not executed for tests in downstream repos #314

Closed
pkirch opened this issue Jun 29, 2022 · 0 comments · Fixed by #316
Closed

CI checkstyle not executed for tests in downstream repos #314

pkirch opened this issue Jun 29, 2022 · 0 comments · Fixed by #316
Assignees
Labels
bug Something isn't working

Comments

@pkirch
Copy link

pkirch commented Jun 29, 2022

Bug Report

Upstream issue eclipse-edc#1567

Describe the Bug

In CI checkstyle is not executed for tests. ./gradlew test does not execute checkstyle.

This bug leads to the problem that checkstyle errors are not caught downstream if working with our current merge pattern (downstream sub-feature branch to downstream feature branch to upstream main branch). However, the checkstyle errors show up upstream.

Expected Behavior

Downstream CI checkstyle should also be executed for tests in order to catch checkstyle errors early before creating an upstream PR.

Observed Behavior

Downstream CI check in PR is not showing checkstyle errors for an end-to-end test.

  1. The checkstyle step in CI is skipped because the PR is against a feature branch and not against main.
  2. The end-to-end tests step in CI is not executing checkstyle.

Steps to Reproduce

Green checkstyle run downstream PR: https://github.com/agera-edc/DataSpaceConnector/runs/7098753291?check_suite_focus=true

image

Red checkstyle run upstream PR: https://github.com/eclipse-dataspaceconnector/DataSpaceConnector/runs/7106397176?check_suite_focus=true

image

Context Information

GitHub CI. See links in Steps to Reproduce.

Detailed Description

.github/workflows/verify.yaml

Checkstyle step is only executed if the event is a pull request and then only against main.

on:
  push:
  pull_request:
    branches: [ main ]
    paths-ignore:
      - '**.md'
      - 'docs/**'
      - 'CODEOWNERS'
      - 'LICENSE'

jobs:
  Checkstyle:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      # lets run Checkstyle explicitly (as opposed to within gradle) due to better reporting capabilities
      - name: Run Checkstyle
        if: github.event_name == 'pull_request'
        uses: nikitasavinov/[email protected]
        with:
          checkstyle_config: resources/edc-checkstyle-config.xml

For end-to-end tests Gradle is only executed to run tests which does not include checkstyle.

  End-To-End-Tests:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: ./.github/actions/setup-build

      - name: End to End Integration Tests
        uses: ./.github/actions/run-tests
        with:
          command: ./gradlew test -DincludeTags="EndToEndTest"

Possible Implementation

End-to-end tests in Gradle should also execute checkstyle.

@pkirch pkirch added the bug Something isn't working label Jun 29, 2022
@cpeeyush cpeeyush moved this to In Progress in Agera EDC Jun 29, 2022
@cpeeyush cpeeyush self-assigned this Jun 29, 2022
@cpeeyush cpeeyush changed the title CI checkstyle not executed for tests CI checkstyle not executed for tests in downstream repos Jun 29, 2022
@cpeeyush cpeeyush linked a pull request Jul 1, 2022 that will close this issue
7 tasks
@cpeeyush cpeeyush moved this from In Progress to In Review in Agera EDC Jul 1, 2022
@cpeeyush cpeeyush moved this from In Review to In Review Upstream in Agera EDC Jul 5, 2022
Repository owner moved this from In Review Upstream to Done in Agera EDC Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants