Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei Stepanov <[email protected]>
  • Loading branch information
Andrei-Stepanov committed Oct 20, 2023
1 parent ed333e0 commit 88c3bba
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
32 changes: 16 additions & 16 deletions src/opensearch/msg_handlers_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ const mkSearchableRpmTestV1 = (fq_msg: FileQueueMessage): SearchableTestRpm => {
} = fq_msg;
const { artifact } = body;
var threadId = mkThreadId(fq_msg);
var testState = _.last(_.split(brokerTopic, '.')) as string;
var testStage = _.nth(_.split(brokerTopic, '.'), -2) as string;
var msgState = _.last(_.split(brokerTopic, '.')) as string;
var msgStage = _.nth(_.split(brokerTopic, '.'), -2) as string;
let testCaseName;
if (isTestStage(brokerTopic)) {
testCaseName = makeTestCaseName(body);
Expand All @@ -106,9 +106,9 @@ const mkSearchableRpmTestV1 = (fq_msg: FileQueueMessage): SearchableTestRpm => {
threadId,
component: _.get(artifact, 'component'),
/** state: complete, running */
testState,
msgState,
/** stage: build, test */
testStage,
msgStage,
brokerTopic,
brokerMsgId,
testCaseName,
Expand Down Expand Up @@ -147,8 +147,8 @@ const mkSearchableMbsTestV1 = (fq_msg: FileQueueMessage): SearchableTestMbs => {
} = fq_msg;
const { artifact } = body;
var threadId = mkThreadId(fq_msg);
var testState = _.last(_.split(brokerTopic, '.')) as string;
var testStage = _.nth(_.split(brokerTopic, '.'), -2) as string;
var msgState = _.last(_.split(brokerTopic, '.')) as string;
var msgStage = _.nth(_.split(brokerTopic, '.'), -2) as string;
let testCaseName;
if (isTestStage(brokerTopic)) {
testCaseName = makeTestCaseName(body);
Expand All @@ -165,9 +165,9 @@ const mkSearchableMbsTestV1 = (fq_msg: FileQueueMessage): SearchableTestMbs => {
modContext: _.get(artifact, 'context'),
threadId,
/** state: complete, running */
testState,
msgState,
/** stage: build, test */
testStage,
msgStage,
brokerTopic,
brokerMsgId,
testCaseName,
Expand Down Expand Up @@ -207,8 +207,8 @@ const mkSearchableComposeTestV1 = (
} = fq_msg;
const { artifact } = body;
var threadId = mkThreadId(fq_msg);
var testState = _.last(_.split(brokerTopic, '.')) as string;
var testStage = _.nth(_.split(brokerTopic, '.'), -2) as string;
var msgState = _.last(_.split(brokerTopic, '.')) as string;
var msgStage = _.nth(_.split(brokerTopic, '.'), -2) as string;
let testCaseName;
if (isTestStage(brokerTopic)) {
testCaseName = makeTestCaseName(body);
Expand All @@ -220,9 +220,9 @@ const mkSearchableComposeTestV1 = (
composeReleaseType: _.get(artifact, 'release_type'),
threadId,
/** state: complete, running */
testState,
msgState,
/** stage: build, test */
testStage,
msgStage,
brokerTopic,
brokerMsgId,
testCaseName,
Expand Down Expand Up @@ -254,8 +254,8 @@ const mkSearchableContainerImageTestV1 = (
} = fq_msg;
const { artifact } = body;
var threadId = mkThreadId(fq_msg);
var testState = _.last(_.split(brokerTopic, '.')) as string;
var testStage = _.nth(_.split(brokerTopic, '.'), -2) as string;
var msgState = _.last(_.split(brokerTopic, '.')) as string;
var msgStage = _.nth(_.split(brokerTopic, '.'), -2) as string;
let testCaseName;
if (isTestStage(brokerTopic)) {
testCaseName = makeTestCaseName(body);
Expand All @@ -278,9 +278,9 @@ const mkSearchableContainerImageTestV1 = (
contRegistryUrl: _.get(artifact, 'registry_url'),
threadId,
/** state: complete, running */
testState,
msgState,
/** stage: build, test */
testStage,
msgStage,
testCaseName,
brokerMsgId,
brokerTopic,
Expand Down
4 changes: 2 additions & 2 deletions src/opensearch/opensearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,15 +236,15 @@ interface SearchableTest {
* * pull-request.test.error -> test
* * brew-build.promote.error -> promote
**/
testStage: string;
msgStage: string;
/**
* state is always the latest part of the message
* Examples:
*
* * brew-build.promote.error -> error
* * brew-build.test.complete -> complete
*/
testState: string;
msgState: string;
/** Broker message id */
brokerMsgId: string;
/** Broker topic */
Expand Down

0 comments on commit 88c3bba

Please sign in to comment.