#Tests fails on GitHub Actions but not locally

1 messages ยท Page 1 of 1 (latest)

urban belfryBOT
#

<@&987246399047479336> please have a look, thanks.

urban belfryBOT
#

While you are waiting for getting help, here are some tips to improve your experience:

Code is much easier to read if posted with syntax highlighting and proper formatting.

If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.

Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.

steel lark
knotty tapir
#

That doesn't look wrong. Could you show the log of the action?

brazen finch
#

error?

#

We had an issue with the gradle-build-action upgrading itself to use gradle 8.0 which caused some issues for us

steel lark
brazen finch
#

hmm not sure, try specifying the gradle version and use gradle instead of gradlew in the Build with Gradle section under with add gradle-version: 7.4.2 (or whatever version you're using)

#

it could be permissions or attributes on the gradle wrapper though could also be the fix

steel lark
#

Bro, my gradle.yml look like:

#

Must i change it?

#

I guess problem in this file

#

This is my entire project, u can check it

#

idk how to resolve this problem, mate...

brazen finch
#

Try my suggestion?

steel lark
#

No, i need to upgrade gradle version?

#

I tired to upgrade gradle to 8.0

#

May be it will help

steel lark
#

After updating gradle

#

Tests fails only on GitHub Actions but not locally

brazen finch
#

you need 6.7 from the look sof it

steel lark
brazen finch
#

add gradle-version: 6.7

#

to your .yml

steel lark
brazen finch
#

yeah

#

whats the error?

steel lark
#

Same errors...

#

Teats fails

#

idk why...

brazen finch
#

its still using gradle 7

#

hmm, try putting the version before build

#

but if it still don't work - fix your gradle.build to be correct

steel lark
#

Where should I put gradle-version: 6.7 in gradle.yml exactly?

#

Like that?

#

No bro, same problem

#

May be i do it incorrectly?

brazen finch
#

was there a new error?

steel lark
#

No bro the same

brazen finch
#

Try this:

#
name: Java CI with Gradle

on: [push, pull_request]

permissions:
  contents: read

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
    - name: Set up JDK 11 and Gradle 6.7
      uses: actions/setup-java@v3
      with:
        java-version: '11'
        distribution: 'temurin'
        gradle-version: '6.7'
    - name: Build with Gradle
      uses: gradle/[email protected]
      with:
        arguments: build
steel lark
#

i can't take it anymore....

#

I'm already set up gradle 8.0, but it didn't help

brazen finch
#

What's above that error?

#

Can you post the full error?

steel lark
#

Yep one secnd

urban belfryBOT
# steel lark

I uploaded your attachments as gist. That way, they are easier to read for everyone, especially mobile users ๐Ÿ‘

steel lark
#

Maybe a problem in the code, but why all tests are successful locally, and in CI they fail

#

Bro I'm very stupid to resolve this...

brazen finch
#

Java version mismatch

#

warning: as of release 10, 'var' is a restricted local variable type and cannot be used for type declarations or as the element type of an array

#

so make your java version the same

steel lark
steel lark
brazen finch
#

that doesn't look right either

#

did you develop on intellij ?

steel lark
#

Yep

brazen finch
#

file > project structure

#

what's the version mentioned there?

#

take a screenshot if u can

steel lark
brazen finch
#

you're using java 15

#

but java 11 specified in the .yml

#

i'd suggest java 17

steel lark
#

I need to roll back to Java 11?

#

second

brazen finch
#

either rollback or upgrade the action

#

java-version: '17'

steel lark
#

17 or 19?

brazen finch
#

any you want

steel lark
#

ok mate

#

'll try it

steel lark
#

Bro its fucked up.....

urban belfryBOT
# steel lark

I uploaded your attachments as gist. That way, they are easier to read for everyone, especially mobile users ๐Ÿ‘

steel lark
#

Idk what i must to do....

brazen finch
#

Maybe just remove var and use the actual type instead

#

PaymentsTest, PaymentsCreditTest, SqlHelperPayment are the only failing unit tests