Skip to content

Commit

Permalink
fix(amazonq): check job status directly before completing (#5281)
Browse files Browse the repository at this point in the history
* fix(amazonq): check job status directly before completing

* address comment

---------

Co-authored-by: David Hasani <[email protected]>
  • Loading branch information
dhasani23 and David Hasani authored Jan 22, 2025
1 parent 561a183 commit e9e2d8b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,9 @@ class CodeModernizerSession(
}
}

result.succeeded -> CodeModernizerJobCompletedResult.JobCompletedSuccessfully(jobId)
result.state == TransformationStatus.COMPLETED -> {
CodeModernizerJobCompletedResult.JobCompletedSuccessfully(jobId)
}

// Should not happen
else -> CodeModernizerJobCompletedResult.JobFailed(jobId, result.jobDetails?.reason().orEmpty())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import org.mockito.kotlin.spy
import org.mockito.kotlin.times
import org.mockito.kotlin.verify
import software.aws.toolkits.jetbrains.services.codemodernizer.model.JobHistoryItem
import software.aws.toolkits.resources.message
import java.time.Duration
import java.time.Instant

Expand All @@ -23,7 +24,7 @@ class CodeModernizerJobHistoryPanelTest {
tablePanelMock.updateTableData(testData)
verify(tablePanelMock, times(1)).setDefaultUI()
verify(tablePanelMock, times(1)).updateTableData(testData)
assertThat(tablePanelMock.headerLabel.text).isEqualTo("Job status")
assertThat(tablePanelMock.headerLabel.text).isEqualTo(message("codemodernizer.toolwindow.job_status.header"))
assertThat(tablePanelMock.jbTable.columnCount).isEqualTo(5)
assertThat(tablePanelMock.jbTable.isEmpty).isFalse()
assertThat(tablePanelMock.tableData).isEqualTo(testData)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ codemodernizer.toolwindow.banner.job_starting=Job is starting.
codemodernizer.toolwindow.banner.no_ongoing_job=No job ongoing.
codemodernizer.toolwindow.banner.run_scan_complete=All steps of transformation successful
codemodernizer.toolwindow.banner.run_scan_info=Select 'Transform' in toolbar to upgrade this package.
codemodernizer.toolwindow.job_status.header=Job status
codemodernizer.toolwindow.job_status.header=Transformation status
codemodernizer.toolwindow.label=Transformation Hub - {0}
codemodernizer.toolwindow.label_no_job=Transformation Hub
codemodernizer.toolwindow.problems_mvn_window_not_found=Unable to display Code Transform results as the Maven window cannot be fetched.
Expand Down

0 comments on commit e9e2d8b

Please sign in to comment.