-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
everything set for publishing before the refactor of package from ai.…
…codium to ai.qodo
- Loading branch information
davidparry
committed
Sep 27, 2024
1 parent
0de5dd4
commit 80c4b77
Showing
5 changed files
with
95 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
import com.github.spotbugs.snom.Effort | ||
import com.github.spotbugs.snom.Confidence | ||
import org.gradle.api.tasks.Delete | ||
plugins { | ||
id 'groovy' | ||
id 'java-gradle-plugin' | ||
id 'maven-publish' | ||
id 'jacoco' | ||
id 'checkstyle' | ||
id 'pmd' | ||
id "com.github.spotbugs" version "6.0.21" | ||
id "com.gradle.plugin-publish" version "1.3.0" | ||
id 'signing' | ||
id 'com.gradleup.shadow' version '8.3.2' | ||
} | ||
|
||
group = 'ai.codium' | ||
version = '1.0-SNAPSHOT' | ||
|
||
repositories { | ||
gradlePluginPortal() | ||
mavenCentral() | ||
} | ||
|
||
|
@@ -42,12 +44,23 @@ dependencies { | |
|
||
gradlePlugin { | ||
plugins { | ||
website = 'https://github.com/Codium-ai/gradle-cover-agent' | ||
vcsUrl = '[email protected]:Codium-ai/gradle-cover-agent.git' | ||
coverAgent { | ||
id = 'ai.codium.plugin.cover-agent' | ||
implementationClass = 'ai.codium.cover.plugin.CoverAgentPlugin' | ||
displayName = 'Cover Agent Plugin' | ||
description = 'A plugin to cover agent functionality.' | ||
tags = ['cover', 'agent', 'plugin'] | ||
|
||
} | ||
} | ||
} | ||
tasks.named('shadowJar', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) { | ||
archiveBaseName.set('shadow') | ||
archiveClassifier.set('') | ||
archiveVersion.set('') | ||
} | ||
|
||
tasks.withType(com.github.spotbugs.snom.SpotBugsTask) { | ||
reports { | ||
|
Binary file not shown.
76 changes: 76 additions & 0 deletions
76
cover-agent-plugin/src/test/groovy/ai/codium/cover/plugin/CoverAgentTaskSpec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
package ai.codium.cover.plugin | ||
|
||
import dev.langchain4j.model.openai.OpenAiChatModel | ||
import org.gradle.api.Project | ||
import org.gradle.testfixtures.ProjectBuilder | ||
import spock.lang.Specification | ||
|
||
class CoverAgentTaskSpec extends Specification { | ||
|
||
Project project = ProjectBuilder.builder().build() | ||
CoverAgentTask task = project.tasks.create('coverAgentTask', CoverAgentTask) | ||
|
||
def "test default properties"() { | ||
expect: | ||
!task.apiKey.isPresent() | ||
!task.wanDBApiKey.isPresent() | ||
!task.iterations.isPresent() | ||
!task.coverAgentBinaryPath.isPresent() | ||
!task.coverage.isPresent() | ||
} | ||
|
||
def "test setting properties"() { | ||
given: | ||
task.apiKey.set("test-api-key") | ||
task.wanDBApiKey.set("test-wandb-api-key") | ||
task.iterations.set(10) | ||
task.coverAgentBinaryPath.set("/path/to/binary") | ||
task.coverage.set(80) | ||
|
||
expect: | ||
task.apiKey.get() == "test-api-key" | ||
task.wanDBApiKey.get() == "test-wandb-api-key" | ||
task.iterations.get() == 10 | ||
task.coverAgentBinaryPath.get() == "/path/to/binary" | ||
task.coverage.get() == 80 | ||
} | ||
|
||
def "test performTask"() { | ||
given: | ||
task.apiKey.set("test-api-key") | ||
task.wanDBApiKey.set("test-wandb-api-key") | ||
task.iterations.set(10) | ||
task.coverAgentBinaryPath.set("/path/to/binary") | ||
task.coverage.set(80) | ||
|
||
and: | ||
CoverAgentBuilder builderMock = Mock(CoverAgentBuilder) | ||
CoverAgent coverAgentMock = Mock(CoverAgent) | ||
OpenAiChatModel.OpenAiChatModelBuilder chatModelBuilderMock = Mock(OpenAiChatModel.OpenAiChatModelBuilder) | ||
|
||
when: | ||
|
||
CoverAgentBuilder.builder() >> builderMock | ||
builderMock.project(_) >> builderMock | ||
builderMock.apiKey(_) >> builderMock | ||
builderMock.wanDBApiKey(_) >> builderMock | ||
builderMock.iterations(_) >> builderMock | ||
builderMock.coverAgentBinaryPath(_) >> builderMock | ||
builderMock.coverage(_) >> builderMock | ||
builderMock.openAiChatModelBuilder(_) >> builderMock | ||
builderMock.build() >> coverAgentMock | ||
OpenAiChatModel.builder() >> chatModelBuilderMock | ||
|
||
task.performTask() | ||
|
||
then: | ||
0 * builderMock.project(project) | ||
0 * builderMock.apiKey("test-api-key") | ||
0 * builderMock.wanDBApiKey("test-wandb-api-key") | ||
0 * builderMock.iterations(10) | ||
0 * builderMock.coverAgentBinaryPath("/path/to/binary") | ||
0 * builderMock.coverage(80) | ||
0 * builderMock.openAiChatModelBuilder(chatModelBuilderMock) | ||
|
||
} | ||
} |
Binary file not shown.