Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions .github/workflows/Android_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,24 +138,28 @@ jobs:
-d "{
\"notes\": \"Test plan for App Startup Time metric\",
\"testName\": \"Startup Time Plan\",
\"metricMetricId\": 1,
\"metricName\": \"App Startup Time\",
\"deviceName\": \"Medium_Phone_API_35\",
\"appName\": \"Alfie.apk\",
\"appVersion\": \"0.8.0\",
\"appPackage\": \"au.com.alfie.ecomm.debug\",
\"mainActivity\": \"au.com.alfie.ecomm.MainActivity\",
\"executionTypeExecutionTypeId\": 1,
\"executionType\": \"Cold Start\",
\"thresholds\": [
{
\"targetValue\": 20000,
\"thresholdTypeThresholdTypeId\": 2,
\"thresholdType\": \"Max\",
\"metricOutputMetricOutputId\": 1
}
],
\"metricParameters\": [
{
\"parameterValue\": \"home-tab\",
\"metricParameterMetricParameterId\": 1
\"metricParameter\": \"elementToWaitFor\"
},
{
\"parameterValue\": \"200000\",
\"metricParameter\": \"timeout\"
}
],
\"executionTypeParameters\": [],
Expand Down Expand Up @@ -397,4 +401,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: android-backend-log
path: backend.log
path: backend.log
10 changes: 5 additions & 5 deletions .github/workflows/iOS_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,27 +93,27 @@ jobs:
-d "{
\"notes\": \"Test plan for App Startup Time metric\",
\"testName\": \"Startup Time Plan\",
\"metricMetricId\": 1,
\"metricName\": \"App Startup Time\",
\"deviceName\": \"iPhone 16 Pro\",
\"appName\": \"Alfie.app\",
\"appVersion\": \"0.8.1\",
\"appPackage\": \"com.mindera.alfie.debug\",
\"executionTypeExecutionTypeId\": 1,
\"executionType\": \"Cold Start\",
\"thresholds\": [
{
\"targetValue\": 5000,
\"thresholdTypeThresholdTypeId\": 2,
\"thresholdType\": \"Max\",
\"metricOutputMetricOutputId\": 1
}
],
\"metricParameters\": [
{
\"parameterValue\": \"account-btn\",
\"metricParameterMetricParameterId\": 1
\"metricParameter\": \"elementToWaitFor\"
},
{
\"parameterValue\": \"200000\",
\"metricParameterMetricParameterId\": 2
\"metricParameter\": \"timeout\"
}
],
\"executionTypeParameters\": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package controllers

import controllers.IControllers.ITestExecutionController
import dtos.TestExecutionResponseDTO
import dtos.TestExecutionRequestDTO
import io.ktor.http.*
import io.ktor.server.application.*
import io.ktor.server.response.*
Expand Down
11 changes: 10 additions & 1 deletion Melmac/src/main/kotlin/core/DependencyModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ val appModule = module {

// --- Repositories ---

// Bootstrap Update
single<IBootstrapUpdateRepository> { BootstrapUpdateRepository(get()) }

// Metrics
single<IMetricRepository> { MetricRepository(get()) }
single<IMetricOutputRepository> { MetricOutputRepository(get()) }
Expand Down Expand Up @@ -106,6 +109,7 @@ val appModule = module {
get(),
get(),
get(),
get(),
get(named("metricsConfigPath"))
)
}
Expand All @@ -132,7 +136,7 @@ val appModule = module {
get()
)
}
single<IThresholdService> { ThresholdService(get()) }
single<IThresholdService> { ThresholdService(get(), get()) }
single<IThresholdTypeService> { ThresholdTypeService(get()) }
single<ITestPlanService> {
TestPlanService(
Expand All @@ -149,6 +153,11 @@ val appModule = module {
get(),
get(),
get(),
get(),
get(),
get(),
get(),
get(),
get()
)
}
Expand Down
1 change: 1 addition & 0 deletions Melmac/src/main/kotlin/domain/dtos/ConfigDataDTO.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package dtos

data class DataConfig(
val lastUpdated: String,
val metrics: List<MetricConfigDTO>,
val thresholdTypes: List<ThresholdTypeConfigDTO>
)
Expand Down

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions Melmac/src/main/kotlin/domain/dtos/TestExecutionRequestDTO.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ package dtos

data class TestExecutionTypeParameterRequestDTO(
val parameterValue: String,
val executionTypeParameterExecutionTypeParameterId: Int,
val executionTypeParameter: String,
val testPlanVersionTestPlanVersionId: Int
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ package dtos

data class TestMetricParameterRequestDTO(
val parameterValue: String,
val metricParameterMetricParameterId: Int,
val metricParameter: String,
val testPlanVersionTestPlanVersionId: Int
)
6 changes: 0 additions & 6 deletions Melmac/src/main/kotlin/domain/dtos/TestPlanRequestDTO.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import dtos.TestMetricParameterRequestDTO
data class TestPlanVersionRequestDTO(
val notes: String?,
val testName: String,
val metricMetricId: Int,
val metricName: String,
val deviceName: String,
val appName: String,
val appVersion: String,
val appPackage: String,
val mainActivity: String? = null,
val executionTypeExecutionTypeId: Int,
val executionType: String,
val thresholds: List<TestThresholdRequestDTO>,
val metricParameters: List<TestMetricParameterRequestDTO>,
val executionTypeParameters: List<TestExecutionTypeParameterRequestDTO>,
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

11 changes: 0 additions & 11 deletions Melmac/src/main/kotlin/domain/dtos/TestSuiteVersionResponseDTO.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package dtos

data class TestThresholdRequestDTO(
val targetValue: Int,
val thresholdTypeThresholdTypeId: Int,
val thresholdType: String,
val testPlanVersionTestPlanVersionId: Int,
val metricOutputMetricOutputId: Int
)
20 changes: 20 additions & 0 deletions Melmac/src/main/kotlin/mappers/AppMapper.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package mappers

import domain.App
import dtos.AppResponseDTO

object AppMapper {
fun toDto(app: App): AppResponseDTO {
return AppResponseDTO(
appId = app.appId ?: throw IllegalStateException("App ID cannot be null"),
appName = app.appName
)
}

fun toDomain(appResponseDTO: AppResponseDTO): App {
return App(
appId = appResponseDTO.appId,
appName = appResponseDTO.appName
)
}
}
22 changes: 22 additions & 0 deletions Melmac/src/main/kotlin/mappers/AppVersionMapper.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package mappers

import domain.AppVersion
import dtos.AppVersionResponseDTO

object AppVersionMapper {
fun toDto(appVersion: AppVersion): AppVersionResponseDTO {
return AppVersionResponseDTO(
appVersionId = appVersion.appVersionId ?: throw IllegalStateException("AppVersion ID cannot be null"),
appId = appVersion.appId,
appVersion = appVersion.appVersion
)
}

fun toDomain(appVersionResponseDTO: AppVersionResponseDTO): AppVersion {
return AppVersion(
appVersionId = appVersionResponseDTO.appVersionId,
appId = appVersionResponseDTO.appId,
appVersion = appVersionResponseDTO.appVersion
)
}
}
25 changes: 25 additions & 0 deletions Melmac/src/main/kotlin/mappers/AvailableDeviceMapper.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package mappers

import dtos.AvailableDeviceDTO
import domain.Device

object AvailableDeviceMapper {
fun toDto(device: Device, osName: String, osVersion: String): AvailableDeviceDTO {
return AvailableDeviceDTO(
id = device.deviceId,
deviceName = device.deviceName,
deviceSerialNumber = device.deviceSerialNumber,
osName = osName,
osVersion = osVersion
)
}

fun toDomain(availableDeviceDTO: AvailableDeviceDTO, osVersionOsVersionId: Int): Device {
return Device(
deviceId = availableDeviceDTO.id,
deviceName = availableDeviceDTO.deviceName,
deviceSerialNumber = availableDeviceDTO.deviceSerialNumber,
osVersionOsVersionId = osVersionOsVersionId
)
}
}
24 changes: 24 additions & 0 deletions Melmac/src/main/kotlin/mappers/DeviceMapper.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package mappers

import domain.Device
import dtos.DeviceResponseDTO

object DeviceMapper {
fun toDto(device: Device): DeviceResponseDTO {
return DeviceResponseDTO(
deviceId = device.deviceId ?: throw IllegalStateException("Device ID cannot be null"),
deviceName = device.deviceName,
deviceSerialNumber = device.deviceSerialNumber,
osVersionOsVersionId = device.osVersionOsVersionId
)
}

fun toDomain(deviceResponseDTO: DeviceResponseDTO): Device {
return Device(
deviceId = deviceResponseDTO.deviceId,
deviceName = deviceResponseDTO.deviceName,
deviceSerialNumber = deviceResponseDTO.deviceSerialNumber,
osVersionOsVersionId = deviceResponseDTO.osVersionOsVersionId
)
}
}
22 changes: 22 additions & 0 deletions Melmac/src/main/kotlin/mappers/ExecutionTypeMapper.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package mappers

import domain.ExecutionType
import dtos.ExecutionTypeResponseDTO

object ExecutionTypeMapper {
fun toDto(executionType: ExecutionType): ExecutionTypeResponseDTO {
return ExecutionTypeResponseDTO(
executionTypeId = executionType.executionTypeId ?: throw IllegalStateException("ExecutionType ID cannot be null"),
executionTypeName = executionType.executionTypeName,
executionTypeDescription = executionType.executionTypeDescription
)
}

fun toDomain(dto: ExecutionTypeResponseDTO): ExecutionType {
return ExecutionType(
executionTypeId = dto.executionTypeId,
executionTypeName = dto.executionTypeName,
executionTypeDescription = dto.executionTypeDescription
)
}
}
20 changes: 20 additions & 0 deletions Melmac/src/main/kotlin/mappers/ExecutionTypeMetricMapper.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package mappers

import domain.ExecutionTypeMetric
import dtos.ExecutionTypeMetricResponseDTO

object ExecutionTypeMetricMapper {
fun toDto(executionTypeMetric: ExecutionTypeMetric): ExecutionTypeMetricResponseDTO {
return ExecutionTypeMetricResponseDTO(
executionTypeExecutionTypeId = executionTypeMetric.executionTypeExecutionTypeId,
metricMetricId = executionTypeMetric.metricMetricId
)
}

fun toDomain(dto: ExecutionTypeMetricResponseDTO): ExecutionTypeMetric {
return ExecutionTypeMetric(
executionTypeExecutionTypeId = dto.executionTypeExecutionTypeId,
metricMetricId = dto.metricMetricId
)
}
}
Loading