summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/pipelines/stores/test_reports/mutations.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/pipelines/stores/test_reports/mutations.js')
-rw-r--r--app/assets/javascripts/pipelines/stores/test_reports/mutations.js33
1 files changed, 29 insertions, 4 deletions
diff --git a/app/assets/javascripts/pipelines/stores/test_reports/mutations.js b/app/assets/javascripts/pipelines/stores/test_reports/mutations.js
index 2531ab1e87c..3652a12a6ba 100644
--- a/app/assets/javascripts/pipelines/stores/test_reports/mutations.js
+++ b/app/assets/javascripts/pipelines/stores/test_reports/mutations.js
@@ -1,16 +1,41 @@
import * as types from './mutation_types';
export default {
- [types.SET_REPORTS](state, testReports) {
- Object.assign(state, { testReports, hasFullReport: true });
+ [types.SET_SUITE](state, { suite = {}, index = null }) {
+ state.testReports.test_suites[index] = { ...suite, hasFullSuite: true };
},
[types.SET_SELECTED_SUITE_INDEX](state, selectedSuiteIndex) {
Object.assign(state, { selectedSuiteIndex });
},
- [types.SET_SUMMARY](state, summary) {
- Object.assign(state, { testReports: { ...state.testReports, ...summary } });
+ [types.SET_SUMMARY](state, testReports) {
+ const { total } = testReports;
+ state.testReports = {
+ ...testReports,
+
+ /*
+ TLDR; this is a temporary mapping that will be updated once
+ test suites have the new data schema
+
+ The backend is in the middle of updating the data schema
+ to have a `total` object containing the total data values.
+ The test suites don't have the new schema, but the summary
+ does. Currently the `test_summary.vue` component takes both
+ the summary and a test suite depending on what is being viewed.
+ This is a temporary change to map the new schema to the old until
+ we can update the schema for the test suites also.
+ Since test suites is an array, it is easier to just map the summary
+ to the old schema instead of mapping every test suite to the new.
+ */
+
+ total_time: total.time,
+ total_count: total.count,
+ success_count: total.success,
+ failed_count: total.failed,
+ skipped_count: total.skipped,
+ error_count: total.error,
+ };
},
[types.TOGGLE_LOADING](state) {