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

Some test cases in IoUtilTest class fails on Macos #3001

Closed
arman-yekkehkhani opened this issue Apr 30, 2024 · 10 comments · Fixed by #3010
Closed

Some test cases in IoUtilTest class fails on Macos #3001

arman-yekkehkhani opened this issue Apr 30, 2024 · 10 comments · Fixed by #3010
Assignees
Labels
bug Something isn't working
Milestone

Comments

@arman-yekkehkhani
Copy link
Contributor

Describe the bug

When running tests in org.eclipse.jkube.kit.common.util.IoUtilTest, some test cases fail with a message similar to the following one:

java.lang.AssertionError: 
Expecting actual:
  ["../../../../../../private/var/folders/5q/fb9_qmc91h76mqsnyqxnf7x00000gn/T/junit14779572735641380464/deployment.yaml"]
to contain exactly in any order:
  ["deployment.yaml"]
elements not found:
  ["deployment.yaml"]
and elements not expected:
  ["../../../../../../private/var/folders/5q/fb9_qmc91h76mqsnyqxnf7x00000gn/T/junit14779572735641380464/deployment.yaml"]

After reading the implementation of method fileTree in class FileAssertions, I found out that the relative path of files in the file tree is not computed correctly on MacOS.

P.S. Fixed the issue. Shall I create a PR for it?

Eclipse JKube version

SNAPSHOT

Component

JKube Kit

Apache Maven version

None

Gradle version

None

Steps to reproduce

  1. It requires MacOS
  2. Run mvn clean test inside jkube-jit module
  3. Observe the error

Expected behavior

Tests inside class IoUtilTest should all pass.

Runtime

other (please specify in additional context)

Kubernetes API Server version

1.25.3

Environment

macOS

Eclipse JKube Logs

No response

Sample Reproducer Project

No response

Additional context

No response

@arman-yekkehkhani arman-yekkehkhani added the bug Something isn't working label Apr 30, 2024
@rohanKanojia
Copy link
Member

@arman-yekkehkhani : Thanks for reporting!

P.S. Fixed the issue. Shall I create a PR for it?

If it's a small change, go ahead and go it. If it's slightly bigger change maybe you want to discuss on this issue first.

@rohanKanojia
Copy link
Member

rohanKanojia commented Apr 30, 2024

@arman-yekkehkhani : Maybe we can also add a GitHub Action workflow for MacOS build. We can create a separate task for this.

arman-yekkehkhani added a commit to arman-yekkehkhani/jkube that referenced this issue Apr 30, 2024
…t with subdirectories, issue eclipse-jkube#3001

Signed-off-by: arman-yekkehkhani <arman.yekkehkhani@gmail.com>
arman-yekkehkhani added a commit to arman-yekkehkhani/jkube that referenced this issue Apr 30, 2024
…t with subdirectories, issue eclipse-jkube#3001

Signed-off-by: arman-yekkehkhani <arman.yekkehkhani@gmail.com>
@arman-yekkehkhani
Copy link
Contributor Author

@rohanKanojia
Thanks! Added the corresponding PR.
Yeah, adding a workflow for MacOS would be nice. But I am not sure how. Do I have access to that?

@rohanKanojia
Copy link
Member

@arman-yekkehkhani : Adding a macOS workflow just means adding a GitHub Action YAML file similar to existing workflows in .github/workflows directory. For MacOS you just need to change the runner to runs-on: macos-latest

@manusa
Copy link
Member

manusa commented Apr 30, 2024

However, this is mostly internal work. We'll take care of this ourselves, thanks!

arman-yekkehkhani added a commit to arman-yekkehkhani/jkube that referenced this issue May 2, 2024
…t with subdirectories, issue eclipse-jkube#3001

Signed-off-by: arman-yekkehkhani <arman.yekkehkhani@gmail.com>
(cherry picked from commit 2442766)
@arman-yekkehkhani
Copy link
Contributor Author

@rohanKanojia I have attached a PR. Could you please take a look at it?

arman-yekkehkhani added a commit to arman-yekkehkhani/jkube that referenced this issue May 3, 2024
… path, issue eclipse-jkube#3001

Signed-off-by: arman-yekkehkhani <arman.yekkehkhani@gmail.com>
@rohanKanojia
Copy link
Member

@arman-yekkehkhani : Unfortunately, I don't have access to MacOS environment where I can test your fix. Could you please attach some screenshot/ GitHub Action log to verify that it's working on MacOS?

@arman-yekkehkhani
Copy link
Contributor Author

@rohanKanojia Here are the screenshot and logs when I run tests locally for module JKube Kit :: Common which contains the test class.
Screenshot 2024-05-03 at 11 13 33

logs:

[INFO] Scanning for projects...
[INFO] 
[INFO] -----------------< org.eclipse.jkube:jkube-kit-common >-----------------
[INFO] Building JKube Kit :: Common 1.17-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from maven-central: https://repo1.maven.org/maven2/org/eclipse/jkube/jkube-kit-api/1.17-SNAPSHOT/maven-metadata.xml
Downloading from maven-central: https://repo1.maven.org/maven2/org/eclipse/jkube/jkube-kit-parent/1.17-SNAPSHOT/maven-metadata.xml
Downloading from maven-central: https://repo1.maven.org/maven2/org/eclipse/jkube/jkube/1.17-SNAPSHOT/maven-metadata.xml
[INFO] 
[INFO] --- maven-enforcer-plugin:3.4.1:enforce (dependency-convergence) @ jkube-kit-common ---
[INFO] Rule 0: org.apache.maven.enforcer.rules.dependency.DependencyConvergence passed
[INFO] 
[INFO] --- maven-resources-plugin:3.3.1:resources (default-resources) @ jkube-kit-common ---
[INFO] Copying 1 resource from src/main/resources to target/classes
[INFO] 
[INFO] --- maven-compiler-plugin:3.13.0:compile (default-compile) @ jkube-kit-common ---
[INFO] Nothing to compile - all classes are up to date.
[INFO] 
[INFO] --- maven-resources-plugin:3.3.1:testResources (default-testResources) @ jkube-kit-common ---
[INFO] Copying 57 resources from src/test/resources to target/test-classes
[INFO] 
[INFO] --- maven-compiler-plugin:3.13.0:testCompile (default-testCompile) @ jkube-kit-common ---
[INFO] Nothing to compile - all classes are up to date.
[INFO] 
[INFO] --- maven-surefire-plugin:3.2.5:test (default-test) @ jkube-kit-common ---
[INFO] Using auto detected provider org.apache.maven.surefire.junitplatform.JUnitPlatformProvider
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.eclipse.jkube.kit.common.util.IoUtilTest
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Tests run: 509, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.099 s -- in org.eclipse.jkube.kit.common.util.IoUtilTest
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 509, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  7.220 s
[INFO] Finished at: 2024-05-03T11:18:26+03:30
[INFO] ------------------------------------------------------------------------

@manusa manusa added this to the 1.17.0 milestone May 3, 2024 — with automated-tasks
manusa pushed a commit that referenced this issue May 3, 2024
…nt with subdirectories, issue #3001

Signed-off-by: arman-yekkehkhani <arman.yekkehkhani@gmail.com>
(cherry picked from commit 2442766)
@rohanKanojia

This comment was marked as outdated.

@arman-yekkehkhani
Copy link
Contributor Author

@rohanKanojia Yeah 👍

manusa pushed a commit that referenced this issue May 8, 2024
…ationTest (#3001)

Signed-off-by: arman-yekkehkhani <arman.yekkehkhani@gmail.com>
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
None yet
3 participants