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

expose more mockk projects as API dependencies #905

Merged
merged 3 commits into from Aug 26, 2022

Conversation

aSemy
Copy link
Contributor

@aSemy aSemy commented Aug 25, 2022

fix #903

maybe helps #891 #889, so the mockk-jvm workaround isn't needed any more?

@aSemy
Copy link
Contributor Author

aSemy commented Aug 25, 2022

Here's the dependencies in the pom.xml for io.mockk:mockk

  <dependencies>
    <dependency>
      <groupId>io.mockk</groupId>
      <artifactId>mockk-dsl</artifactId>
      <version>1.12.8-SNAPSHOT</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>io.mockk</groupId>
      <artifactId>mockk-agent</artifactId>
      <version>1.12.8-SNAPSHOT</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>io.mockk</groupId>
      <artifactId>mockk-agent-api</artifactId>
      <version>1.12.8-SNAPSHOT</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.jetbrains.kotlin</groupId>
      <artifactId>kotlin-stdlib-jdk8</artifactId>
      <version>1.7.10</version>
      <scope>runtime</scope>
    </dependency>
  </dependencies>
</project>

And for io.mockk:mockk-android

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.jetbrains.kotlinx</groupId>
        <artifactId>kotlinx-coroutines-bom</artifactId>
        <version>1.6.4</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>io.mockk</groupId>
      <artifactId>mockk</artifactId>
      <version>1.12.8-SNAPSHOT</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>io.mockk</groupId>
      <artifactId>mockk-agent-api</artifactId>
      <version>1.12.8-SNAPSHOT</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>io.mockk</groupId>
      <artifactId>mockk-agent-android</artifactId>
      <version>1.12.8-SNAPSHOT</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.jetbrains.kotlin</groupId>
      <artifactId>kotlin-stdlib-jdk8</artifactId>
      <version>1.7.10</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.jetbrains.kotlinx</groupId>
      <artifactId>kotlinx-coroutines-core</artifactId>
      <scope>runtime</scope>
    </dependency>
  </dependencies>

@Raibaz
Copy link
Collaborator

Raibaz commented Aug 25, 2022

LGTM.

@SimonMarquis can you please try deploying this branch to your local maven repo and see if it fixes your issue?

@aSemy
Copy link
Contributor Author

aSemy commented Aug 25, 2022

io.mockk:mockk looks correct compared to 1.12.5 https://repo.maven.apache.org/maven2/io/mockk/mockk/1.12.5/mockk-1.12.5.pom

I think it's a mistake that kotlinx-coroutines is exposed in io.mockk:mockk-android, that's a change from 1.12.5 https://repo.maven.apache.org/maven2/io/mockk/mockk-android/1.12.5/mockk-android-1.12.5.pom

@aSemy
Copy link
Contributor Author

aSemy commented Aug 25, 2022

Removing the Coroutines dependencies from mockk-android seems to have fixed the pom.xml, now let's see if the tests still run...

  <dependencies>
    <dependency>
      <groupId>io.mockk</groupId>
      <artifactId>mockk</artifactId>
      <version>1.12.8-SNAPSHOT</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>io.mockk</groupId>
      <artifactId>mockk-agent-api</artifactId>
      <version>1.12.8-SNAPSHOT</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>io.mockk</groupId>
      <artifactId>mockk-agent-android</artifactId>
      <version>1.12.8-SNAPSHOT</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.jetbrains.kotlin</groupId>
      <artifactId>kotlin-stdlib-jdk8</artifactId>
      <version>1.7.10</version>
      <scope>compile</scope>
    </dependency>
  </dependencies>

@SimonMarquis
Copy link
Contributor

56b30de works fine on my setup 👍

@SimonMarquis
Copy link
Contributor

SimonMarquis commented Sep 12, 2022

👋 Hi, is there any ETA for this fix to land in the 1.12.8?
Or can we "safely" use the mockk-jvm dependency on androidTest configurations?

@Raibaz
Copy link
Collaborator

Raibaz commented Sep 15, 2022

Just released v1.12.8, sorry about the delay.

@SimonMarquis
Copy link
Contributor

🚀 awesome thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing transitive dependencies for Android tests
3 participants