Skip to content

Commit 3619388

Browse files
committed
changed coverage option to ignore only *Codecs
1 parent 6f8487d commit 3619388

File tree

6 files changed

+52
-8
lines changed

6 files changed

+52
-8
lines changed

esw-agent-pekko/esw-agent-pekko-app/src/main/scala/esw/agent/pekko/app/AgentWiring.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ class AgentWiring(agentSettings: AgentSettings, hostConfigPath: Option[String],
4343
private lazy val configUtils = new ConfigUtils(configClientService)
4444
private lazy val versionManager = new VersionManager(agentSettings.versionConfPath, configUtils)
4545

46-
lazy val processOutput = new ProcessOutput()
47-
lazy val processExecutor = new ProcessExecutor(processOutput)
48-
lazy val processManager = new ProcessManager(locationService, versionManager, processExecutor, agentSettings)
49-
lazy val agentActor = new AgentActor(processManager, configUtils, hostConfigPath, isConfigLocal)
46+
lazy val processOutput = new ProcessOutput()
47+
lazy val processExecutor = new ProcessExecutor(processOutput)
48+
lazy val processManager = new ProcessManager(locationService, versionManager, processExecutor, agentSettings)
49+
private lazy val agentActor = new AgentActor(processManager, configUtils, hostConfigPath, isConfigLocal)
5050

5151
lazy val lazyAgentRegistration: Future[RegistrationResult] =
5252
locationService.register(PekkoRegistrationFactory.make(agentConnection, agentRef))
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//package esw.agent.pekko.app
2+
//
3+
// XXX TODO FIXME
4+
//import csw.prefix.models.Prefix
5+
//import org.scalatest.funsuite.AnyFunSuiteLike
6+
//
7+
//class AgentCliCommandTest extends AnyFunSuiteLike {
8+
//
9+
// test("testPrefixParser") {
10+
// val prefix = "ESW.test"
11+
//// val hostConfigPath = None
12+
//// val local = true
13+
//// val s = AgentCliCommand.StartOptions(prefix, hostConfigPath, local)
14+
// assert(AgentCliCommand.prefixParser.parse(prefix, 0, 0) == Prefix("ESW.test"))
15+
// }
16+
//}

esw-agent-pekko/esw-agent-pekko-client/src/main/scala/esw/agent/pekko/client/AgentPekkoSerializer.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ import esw.agent.service.api.models.AgentResponse
77
import io.bullet.borer.Codec
88
import io.bullet.borer.derivation.MapBasedCodecs.deriveCodec
99

10+
//noinspection ScalaUnusedSymbol
1011
// $COVERAGE-OFF$
1112
/*
1213
* Serializer being used in ser(de) of agents actor messages
1314
*/
1415
class AgentPekkoSerializer extends CborPekkoSerializer[AgentPekkoSerializable] with AgentActorCodecs {
1516
override def identifier: Int = 26726
1617

17-
// for some reason scala3 is not able to infer this from the original location hence moved here
18+
// for some reason, scala3 is not able to infer this from the original location hence moved here
1819
implicit lazy val agentResponseCodec: Codec[AgentResponse] = deriveCodec
1920

2021
register[AgentRemoteCommand]
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//package esw.agent.pekko.client
2+
//
3+
//import org.scalatest.funsuite.AnyFunSuiteLike
4+
//import esw.agent.service.api.models.{AgentResponse, Failed}
5+
//import org.scalatest.BeforeAndAfterAll
6+
//
7+
// XXX TODO FIXME
8+
//class AgentPekkoSerializerTest extends AnyFunSuiteLike {
9+
//
10+
// test("Should serialize and deserialize") {
11+
// val s = AgentPekkoSerializer()
12+
// import s.*
13+
// val t: AgentResponse = Failed("test")
14+
// val b = toBinary(t)
15+
// try {
16+
// fromBinary(b, Some(Failed.getClass)).asInstanceOf[Failed]
17+
// }
18+
// catch {
19+
// case e: Exception =>
20+
// e.printStackTrace()
21+
// }
22+
// }
23+
//}

esw-sm/esw-sm-impl/src/test/scala/esw/sm/impl/utils/AgentUtilTest.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,13 @@ class AgentUtilTest extends BaseTestSuite {
150150

151151
val response = agentUtil.provision(provisionConfig).futureValue
152152
response shouldBe a[ProvisionResponse.SpawningSequenceComponentsFailed]
153-
val failureMgs = response.asInstanceOf[ProvisionResponse.SpawningSequenceComponentsFailed].failureResponses.head
153+
val instance = response.asInstanceOf[ProvisionResponse.SpawningSequenceComponentsFailed]
154+
val failureMgs = instance.failureResponses.head
154155
// assert that failure msg has necessary info
155156
failureMgs.contains(eswPrimaryMachine.prefix.toString()) shouldBe true
156157
failureMgs.contains(eswSeqComp2Name) shouldBe true
157158
failureMgs.contains(errorMsg) shouldBe true
159+
instance.msg shouldEqual s"Failed to provision: spawning sequence components failed with ${instance.failureResponses}"
158160

159161
verify(locationServiceUtil).listPekkoLocationsBy(Machine)
160162
verify(agentAllocator).allocate(provisionConfig, machines)
@@ -203,6 +205,7 @@ class AgentUtilTest extends BaseTestSuite {
203205
when(versionManager.getScriptVersion).thenReturn(Future.failed(FetchingScriptVersionFailed(errorMsg)))
204206

205207
agentUtil.provision(provisionConfig).futureValue should ===(ProvisionVersionFailure(errorMsg))
208+
ProvisionVersionFailure(errorMsg).msg should ===(s"Failed to provision: error in fetching version $errorMsg")
206209
}
207210
}
208211

project/Common.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ object Common {
8282
aggregate, // verify if this needs to be here or our configuration is wrong
8383
unidocGenjavadocVersion // verify if this needs to be here or our configuration is wrong
8484
),
85-
coverageExcludedFiles :=
86-
".*/AgentPekkoSerializer;.*/AgentWiring;.*/AgentApp;.*/ProcessExecutor;.*/GatewayMain;.*/SequenceManagerApp;.*/SimulationScript;.*/SequencerWiring;.*/SequenceComponentWiring;.*/SequencerApp;.*/EswCommand;.*/Keycloak;.*/AgentServiceApp;.*/BuildInfo;.*/.*Codecs;.*/AgentCliCommand;.*/AgentServiceApi;.*/ComponentNotFoundException;.*/ContainerConfig;.*/EitherExt;.*/EitherOps;.*/Failed;.*/EventApi;.*/StartOptions;.*/StartOptions;.*/ScriptError;.*/UnhandledCommandException;.*/ProvisionVersionFailure;.*/SequenceManagerResponses;.*/Timeouts;.*/ProcessUtils;.*/HostConfig"
85+
// coverageExcludedFiles :=
86+
// ".*/AgentPekkoSerializer;.*/AgentWiring;.*/AgentApp;.*/ProcessExecutor;.*/GatewayMain;.*/SequenceManagerApp;.*/SimulationScript;.*/SequencerWiring;.*/SequenceComponentWiring;.*/SequencerApp;.*/EswCommand;.*/Keycloak;.*/AgentServiceApp;.*/BuildInfo;.*/.*Codecs;.*/AgentCliCommand;.*/AgentServiceApi;.*/ComponentNotFoundException;.*/EitherExt;.*/EitherOps;.*/Failed;.*/EventApi;.*/StartOptions;.*/ScriptError;.*/UnhandledCommandException"
87+
coverageExcludedFiles := ".*/.*Codecs"
8788
)
8889
}

0 commit comments

Comments
 (0)