feat(suite): Implement Suites (#1239)
* feat(suite): Implement Suites Fixes #1230 * Update docs * Fix variable alignment * Prevent always-run endpoint from running if a context placeholder fails to resolve in the URL * Return errors when a context placeholder path fails to resolve * Add a couple of unit tests * Add a couple of unit tests * fix(ui): Update group count properly Fixes #1233 * refactor: Pass down entire config instead of several sub-configs * fix: Change default suite interval and timeout * fix: Deprecate disable-monitoring-lock in favor of concurrency * fix: Make sure there are no duplicate keys * Refactor some code * Update watchdog/watchdog.go * Update web/app/src/components/StepDetailsModal.vue Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * chore: Remove useless log * fix: Set default concurrency to 3 instead of 5 --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
1 parent
10cabb9dde
commit
d668a14703
74 files changed
+7513
-652
No files matched your search
@@ -10,20 +10,62 @@
|
||||
:style="`top: ${top}px; left: ${left}px;`"
|
||||
>
|
||||
<div v-if="result" class="space-y-2">
|
||||
<!-- Status (for suite results) -->
|
||||
<div v-if="isSuiteResult" class="flex items-center gap-2">
|
||||
<span :class="[
|
||||
'inline-block w-2 h-2 rounded-full',
|
||||
result.success ? 'bg-green-500' : 'bg-red-500'
|
||||
]"></span>
|
||||
<span class="text-xs font-semibold">
|
||||
{{ result.success ? 'Suite Passed' : 'Suite Failed' }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<!-- Timestamp -->
|
||||
<div>
|
||||
<div class="text-xs font-semibold text-muted-foreground uppercase tracking-wider">Timestamp</div>
|
||||
<div class="font-mono text-xs">{{ prettifyTimestamp(result.timestamp) }}</div>
|
||||
</div>
|
||||
|
||||
<!-- Suite Info (for suite results) -->
|
||||
<div v-if="isSuiteResult && result.endpointResults">
|
||||
<div class="text-xs font-semibold text-muted-foreground uppercase tracking-wider">Endpoints</div>
|
||||
<div class="font-mono text-xs">
|
||||
<span :class="successCount === endpointCount ? 'text-green-500' : 'text-yellow-500'">
|
||||
{{ successCount }}/{{ endpointCount }} passed
|
||||
</span>
|
||||
</div>
|
||||
<!-- Endpoint breakdown -->
|
||||
<div v-if="result.endpointResults.length > 0" class="mt-1 space-y-0.5">
|
||||
<div
|
||||
v-for="(endpoint, index) in result.endpointResults.slice(0, 5)"
|
||||
:key="index"
|
||||
class="flex items-center gap-1 text-xs"
|
||||
>
|
||||
<span :class="endpoint.success ? 'text-green-500' : 'text-red-500'">
|
||||
{{ endpoint.success ? '✓' : '✗' }}
|
||||
</span>
|
||||
<span class="truncate">{{ endpoint.name }}</span>
|
||||
<span class="text-muted-foreground">({{ (endpoint.duration / 1000000).toFixed(0) }}ms)</span>
|
||||
</div>
|
||||
<div v-if="result.endpointResults.length > 5" class="text-xs text-muted-foreground">
|
||||
... and {{ result.endpointResults.length - 5 }} more
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Response Time -->
|
||||
<div>
|
||||
<div class="text-xs font-semibold text-muted-foreground uppercase tracking-wider">Response Time</div>
|
||||
<div class="font-mono text-xs">{{ (result.duration / 1000000).toFixed(0) }}ms</div>
|
||||
<div class="text-xs font-semibold text-muted-foreground uppercase tracking-wider">
|
||||
{{ isSuiteResult ? 'Total Duration' : 'Response Time' }}
|
||||
</div>
|
||||
<div class="font-mono text-xs">
|
||||
{{ isSuiteResult ? (result.duration / 1000000).toFixed(0) : (result.duration / 1000000).toFixed(0) }}ms
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Conditions -->
|
||||
<div v-if="result.conditionResults && result.conditionResults.length">
|
||||
<!-- Conditions (for endpoint results) -->
|
||||
<div v-if="!isSuiteResult && result.conditionResults && result.conditionResults.length">
|
||||
<div class="text-xs font-semibold text-muted-foreground uppercase tracking-wider">Conditions</div>
|
||||
<div class="font-mono text-xs space-y-0.5">
|
||||
<div
|
||||
@@ -54,8 +96,8 @@
|
||||
|
||||
<script setup>
|
||||
/* eslint-disable no-undef */
|
||||
import { ref, watch, nextTick } from 'vue'
|
||||
import { helper } from '@/mixins/helper'
|
||||
import { ref, watch, nextTick, computed } from 'vue'
|
||||
import { prettifyTimestamp } from '@/utils/time'
|
||||
|
||||
const props = defineProps({
|
||||
event: {
|
||||
@@ -74,8 +116,22 @@ const top = ref(0)
|
||||
const left = ref(0)
|
||||
const tooltip = ref(null)
|
||||
|
||||
// Methods from helper mixin
|
||||
const { prettifyTimestamp } = helper.methods
|
||||
// Computed properties
|
||||
const isSuiteResult = computed(() => {
|
||||
return props.result && props.result.endpointResults !== undefined
|
||||
})
|
||||
|
||||
const endpointCount = computed(() => {
|
||||
if (!isSuiteResult.value || !props.result.endpointResults) return 0
|
||||
return props.result.endpointResults.length
|
||||
})
|
||||
|
||||
const successCount = computed(() => {
|
||||
if (!isSuiteResult.value || !props.result.endpointResults) return 0
|
||||
return props.result.endpointResults.filter(e => e.success).length
|
||||
})
|
||||
|
||||
// Methods are imported from utils/time
|
||||
|
||||
const reposition = async () => {
|
||||
if (!props.event || !props.event.type) return
|
||||
|
||||
Reference in new issue
Block a user