Repository: getgauge/gauge (go)

Issue:
Mismatch of steps and table names in report when launch data driven spec in multithreading
Mismatch within steps and names in the table in the report after running data-driven specifications in multiple threads. The issue appears after upgrade from 1.0.6 to 1.0.8.

**Expected behavior**
Table data in report and steps bellow should be matched to each other

**Steps to reproduce:** 
- create data-driven spec with using data from table in step name
- run it multiple threads
- get report
- compare names in the table above and steps bellow 

**Versions**
_Configuration when the issue reproduced:_ 
Gauge version: 1.0.8
Commit Hash: 28617ea
html-report (4.0.10) or lower (also checked with 4.0.6 and 4.0.3)
java (0.7.4) or 0.7.3
screenshot (0.0.1)
spectacle (0.1.3)
xml-report (0.2.2)

_Configuration when the issue didn't reproduce:_
Gauge version: 1.0.6
Commit Hash: 2bc49db
html-report (4.0.6)
java (0.7.3)
screenshot (0.0.1)
spectacle (0.1.3)
xml-report (0.2.2)


**Comands** 
gauge:execute 
-Dtags=%gauge.tags%
-DinParallel=true
-Dnodes=%parallel.threads%
-DspecsDir=%specsDir%

**Environment**
Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-76-generic x86_64)


Pull request:
Fix for mismatch of steps and table names in report
Fixes #1633

Patch:
diff --git a/execution/merge.go b/execution/merge.go
index 16f17789..5d02ba1c 100644
--- a/execution/merge.go
+++ b/execution/merge.go
@@ -77,7 +77,6 @@ func mergeResults(results []*result.SpecResult) *result.SpecResult {
 		if res.GetFailed() {
 			specResult.IsFailed = true
 		}
-		var tableRowIndex int32
 		var tableRows []*m.ProtoTableRow
 		for _, item := range res.ProtoSpec.Items {
 			switch item.ItemType {
@@ -85,7 +84,12 @@ func mergeResults(results []*result.SpecResult) *result.SpecResult {
 				scnResults = append(scnResults, item)
 				modifySpecStats(item.Scenario, specResult)
 			case m.ProtoItem_TableDrivenScenario:
-				tableRowIndex = item.TableDrivenScenario.TableRowIndex
+				tableRowIndex := item.TableDrivenScenario.TableRowIndex
+				if _, ok := includedTableRowIndexMap[tableRowIndex]; !ok {
+					table.Rows = append(table.Rows, tableRows...)
+					includedTableRowIndexMap[tableRowIndex] = true
+				}
+				item.TableDrivenScenario.TableRowIndex = int32(len(table.Rows) - 1)
 				scnResults = append(scnResults, item)
 				heading := item.TableDrivenScenario.Scenario.ScenarioHeading
 				dataTableScnResults[heading] = append(dataTableScnResults[heading], item.TableDrivenScenario)
@@ -93,16 +97,12 @@ func mergeResults(results []*result.SpecResult) *result.SpecResult {
 				table.Headers = item.Table.Headers
 				tableRows = item.Table.GetRows()
 				if len(res.GetPreHook()) > 0 {
-					tableRowIndex = res.GetPreHook()[0].GetTableRowIndex()
+					table.Rows = append(table.Rows, tableRows...)
 				}
 			}
 		}
-		if _, ok := includedTableRowIndexMap[tableRowIndex]; !ok {
-			table.Rows = append(table.Rows, tableRows...)
-			includedTableRowIndexMap[tableRowIndex] = true
-		}
-		addHookFailure(tableRowIndex, res.GetPreHook(), specResult.AddPreHook)
-		addHookFailure(tableRowIndex, res.GetPostHook(), specResult.AddPostHook)
+		addHookFailure(table, res.GetPreHook(), specResult.AddPreHook)
+		addHookFailure(table, res.GetPostHook(), specResult.AddPostHook)
 	}
 	if InParallel {
 		specResult.ExecutionTime = max
@@ -115,9 +115,9 @@ func mergeResults(results []*result.SpecResult) *result.SpecResult {
 	return specResult
 }
 
-func addHookFailure(tableRowIndex int32, f []*m.ProtoHookFailure, add func(...*m.ProtoHookFailure)) {
+func addHookFailure(table *m.ProtoTable, f []*m.ProtoHookFailure, add func(...*m.ProtoHookFailure)) {
 	for _, h := range f {
-		h.TableRowIndex = tableRowIndex
+		h.TableRowIndex = int32(len(table.Rows) - 1)
 	}
 	add(f...)
 }
diff --git a/version/version.go b/version/version.go
index 935642b8..b3baed97 100644
--- a/version/version.go
+++ b/version/version.go
@@ -14,7 +14,7 @@ import (
 )
 
 // CurrentGaugeVersion represents the current version of Gauge
-var CurrentGaugeVersion = &Version{1, 0, 8}
+var CurrentGaugeVersion = &Version{1, 0, 9}
 
 // BuildMetadata represents build information of current release (e.g, nightly build information)
 var BuildMetadata = ""
@@ -56,7 +56,7 @@ func VersionError(level, text string, err error) error {
 	return fmt.Errorf("error parsing %s version %s to integer. %s", level, text, err.Error())
 }
 
-func (Version *Version) IsBetween(lower *Version, greater *Version) bool {
+func (Version *Version) IsBetween(lower, greater *Version) bool {
 	return Version.IsGreaterThanEqualTo(lower) && Version.IsLesserThanEqualTo(greater)
 }
 
@@ -80,7 +80,7 @@ func (Version *Version) IsEqualTo(version1 *Version) bool {
 	return IsEqual(Version.Major, version1.Major) && IsEqual(Version.Minor, version1.Minor) && IsEqual(Version.Patch, version1.Patch)
 }
 
-func CompareVersions(first *Version, second *Version, compareFunc func(int, int) bool) bool {
+func CompareVersions(first, second *Version, compareFunc func(int, int) bool) bool {
 	if compareFunc(first.Major, second.Major) {
 		return true
 	} else if IsEqual(first.Major, second.Major) {


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 5d525120..5ad77373 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -195,3 +195,30 @@ jobs:
         with:
           name: ft-logs-${{ matrix.os }}
           path: gauge-tests/logs
+
+  build:
+    name: Build ${{ matrix.os }} artifacts
+    runs-on: ${{ matrix.os }}
+    needs: [ functional-tests, lsp-tests ]
+    strategy:
+      matrix:
+        os: [windows-latest, ubuntu-latest, macos-latest]
+
+    steps:
+      - name: Set up Go 1.13
+        uses: actions/setup-go@v1
+        with:
+          go-version: 1.13
+        id: go
+
+      - name: Check out code into the Go module directory
+        uses: actions/checkout@v2
+
+      - name: Build distro for ${{ matrix.os }}
+        run: go run build/make.go  && go run build/make.go --distro
+
+      - name: Upload artifacts for ${{ matrix.os }}
+        uses: actions/upload-artifact@v1
+        with:
+          name: gauge-artifact-for-${{ matrix.os }}
+          path: deploy
\ No newline at end of file
diff --git a/execution/merge_test.go b/execution/merge_test.go
index ac55472a..a8dcd332 100644
--- a/execution/merge_test.go
+++ b/execution/merge_test.go
@@ -77,16 +77,14 @@ func TestMergeResults(t *testing.T) {
 	got := mergeResults([]*result.SpecResult{
 		{
 			ProtoSpec: &gm.ProtoSpec{
-				PreHookFailures: []*gm.ProtoHookFailure{{StackTrace: "stacktrace"}},
-				SpecHeading:     "heading", FileName: "filename", Tags: []string{"tags"},
-				PostHookFailures: []*gm.ProtoHookFailure{{StackTrace: "stacktrace"}},
+				SpecHeading: "heading", FileName: "filename", Tags: []string{"tags"},
 				Items: []*gm.ProtoItem{
-					{ItemType: gm.ProtoItem_Table, Table: &gm.ProtoTable{Headers: &gm.ProtoTableRow{Cells: []string{"a"}}, Rows: []*gm.ProtoTableRow{{Cells: []string{"b"}}}}},
+					{ItemType: gm.ProtoItem_Table, Table: &gm.ProtoTable{Headers: &gm.ProtoTableRow{Cells: []string{"a"}}, Rows: []*gm.ProtoTableRow{{Cells: []string{"d"}}}}},
 					{ItemType: gm.ProtoItem_Scenario, Scenario: &gm.ProtoScenario{ExecutionStatus: gm.ExecutionStatus_PASSED, ScenarioHeading: "scenario Heading1"}},
 					{
 						ItemType: gm.ProtoItem_TableDrivenScenario, TableDrivenScenario: &gm.ProtoTableDrivenScenario{
 							Scenario:      &gm.ProtoScenario{ExecutionStatus: gm.ExecutionStatus_PASSED, ScenarioHeading: "scenario Heading2"},
-							TableRowIndex: 0,
+							TableRowIndex: 2,
 						},
 					},
 				},
@@ -94,9 +92,21 @@ func TestMergeResults(t *testing.T) {
 		},
 		{
 			ProtoSpec: &gm.ProtoSpec{
-				PreHookFailures: []*gm.ProtoHookFailure{{StackTrace: "stacktrace1"}},
-				SpecHeading:     "heading", FileName: "filename", Tags: []string{"tags"},
-				PostHookFailures: []*gm.ProtoHookFailure{{StackTrace: "stacktrace1"}},
+				SpecHeading: "heading", FileName: "filename", Tags: []string{"tags"},
+				Items: []*gm.ProtoItem{
+					{ItemType: gm.ProtoItem_Table, Table: &gm.ProtoTable{Headers: &gm.ProtoTableRow{Cells: []string{"a"}}, Rows: []*gm.ProtoTableRow{{Cells: []string{"b"}}}}},
+					{
+						ItemType: gm.ProtoItem_TableDrivenScenario, TableDrivenScenario: &gm.ProtoTableDrivenScenario{
+							Scenario:      &gm.ProtoScenario{ExecutionStatus: gm.ExecutionStatus_PASSED, ScenarioHeading: "scenario Heading2"},
+							TableRowIndex: 0,
+						},
+					},
+				},
+			}, ExecutionTime: int64(2),
+		},
+		{
+			ProtoSpec: &gm.ProtoSpec{
+				SpecHeading: "heading", FileName: "filename", Tags: []string{"tags"},
 				Items: []*gm.ProtoItem{
 					{ItemType: gm.ProtoItem_Table, Table: &gm.ProtoTable{Headers: &gm.ProtoTableRow{Cells: []string{"a"}}, Rows: []*gm.ProtoTableRow{{Cells: []string{"c"}}}}},
 					{
@@ -111,11 +121,9 @@ func TestMergeResults(t *testing.T) {
 	})
 	want := &result.SpecResult{
 		ProtoSpec: &gm.ProtoSpec{
-			PreHookFailures: []*gm.ProtoHookFailure{{StackTrace: "stacktrace"}, {StackTrace: "stacktrace1", TableRowIndex: 1}},
-			SpecHeading:     "heading", FileName: "filename", Tags: []string{"tags"},
-			PostHookFailures: []*gm.ProtoHookFailure{{StackTrace: "stacktrace"}, {StackTrace: "stacktrace1", TableRowIndex: 1}},
+			SpecHeading: "heading", FileName: "filename", Tags: []string{"tags"},
 			Items: []*gm.ProtoItem{
-				{ItemType: gm.ProtoItem_Table, Table: &gm.ProtoTable{Headers: &gm.ProtoTableRow{Cells: []string{"a"}}, Rows: []*gm.ProtoTableRow{{Cells: []string{"b"}}, {Cells: []string{"c"}}}}},
+				{ItemType: gm.ProtoItem_Table, Table: &gm.ProtoTable{Headers: &gm.ProtoTableRow{Cells: []string{"a"}}, Rows: []*gm.ProtoTableRow{{Cells: []string{"d"}}, {Cells: []string{"b"}}, {Cells: []string{"c"}}}}},
 				{ItemType: gm.ProtoItem_Scenario, Scenario: &gm.ProtoScenario{ExecutionStatus: gm.ExecutionStatus_PASSED, ScenarioHeading: "scenario Heading1"}},
 				{
 					ItemType: gm.ProtoItem_TableDrivenScenario, TableDrivenScenario: &gm.ProtoTableDrivenScenario{
@@ -129,9 +137,15 @@ func TestMergeResults(t *testing.T) {
 						TableRowIndex: 1,
 					},
 				},
+				{
+					ItemType: gm.ProtoItem_TableDrivenScenario, TableDrivenScenario: &gm.ProtoTableDrivenScenario{
+						Scenario:      &gm.ProtoScenario{ExecutionStatus: gm.ExecutionStatus_PASSED, ScenarioHeading: "scenario Heading2"},
+						TableRowIndex: 2,
+					},
+				},
 			}, IsTableDriven: false,
 		},
-		ScenarioCount: 3, ScenarioSkippedCount: 0, ScenarioFailedCount: 0, IsFailed: false, Skipped: false, ExecutionTime: int64(3),
+		ScenarioCount: 4, ScenarioSkippedCount: 0, ScenarioFailedCount: 0, IsFailed: false, Skipped: false, ExecutionTime: int64(5),
 	}
 
 	if !reflect.DeepEqual(got, want) {
@@ -139,67 +153,45 @@ func TestMergeResults(t *testing.T) {
 	}
 }
 
-func TestMergeSkippedResults(t *testing.T) {
+func TestMergeResultsWithPreHookFailure(t *testing.T) {
 	got := mergeResults([]*result.SpecResult{
 		{
 			ProtoSpec: &gm.ProtoSpec{
 				PreHookFailures: []*gm.ProtoHookFailure{{StackTrace: "stacktrace"}},
 				SpecHeading:     "heading", FileName: "filename", Tags: []string{"tags"},
-				PostHookFailures: []*gm.ProtoHookFailure{{StackTrace: "stacktrace"}},
 				Items: []*gm.ProtoItem{
 					{ItemType: gm.ProtoItem_Table, Table: &gm.ProtoTable{Headers: &gm.ProtoTableRow{Cells: []string{"a"}}, Rows: []*gm.ProtoTableRow{{Cells: []string{"b"}}}}},
-					{ItemType: gm.ProtoItem_Scenario, Scenario: &gm.ProtoScenario{ExecutionStatus: gm.ExecutionStatus_SKIPPED, ScenarioHeading: "scenario Heading1", SkipErrors: []string{"error"}}},
-					{
-						ItemType: gm.ProtoItem_TableDrivenScenario, TableDrivenScenario: &gm.ProtoTableDrivenScenario{
-							Scenario:      &gm.ProtoScenario{ExecutionStatus: gm.ExecutionStatus_SKIPPED, ScenarioHeading: "scenario Heading2", SkipErrors: []string{"error"}},
-							TableRowIndex: 0,
-						},
-					},
 				},
 			}, ExecutionTime: int64(1),
-			Skipped: true,
 		},
 		{
 			ProtoSpec: &gm.ProtoSpec{
 				PreHookFailures: []*gm.ProtoHookFailure{{StackTrace: "stacktrace1"}},
 				SpecHeading:     "heading", FileName: "filename", Tags: []string{"tags"},
-				PostHookFailures: []*gm.ProtoHookFailure{{StackTrace: "stacktrace1"}},
+				Items: []*gm.ProtoItem{
+					{ItemType: gm.ProtoItem_Table, Table: &gm.ProtoTable{Headers: &gm.ProtoTableRow{Cells: []string{"a"}}, Rows: []*gm.ProtoTableRow{{Cells: []string{"d"}}}}},
+				},
+			}, ExecutionTime: int64(2),
+		},
+		{
+			ProtoSpec: &gm.ProtoSpec{
+				PreHookFailures: []*gm.ProtoHookFailure{{StackTrace: "stacktrace2"}},
+				SpecHeading:     "heading", FileName: "filename", Tags: []string{"tags"},
 				Items: []*gm.ProtoItem{
 					{ItemType: gm.ProtoItem_Table, Table: &gm.ProtoTable{Headers: &gm.ProtoTableRow{Cells: []string{"a"}}, Rows: []*gm.ProtoTableRow{{Cells: []string{"c"}}}}},
-					{
-						ItemType: gm.ProtoItem_TableDrivenScenario, TableDrivenScenario: &gm.ProtoTableDrivenScenario{
-							Scenario:      &gm.ProtoScenario{ExecutionStatus: gm.ExecutionStatus_SKIPPED, ScenarioHeading: "scenario Heading2", SkipErrors: []string{"error"}},
-							TableRowIndex: 1,
-						},
-					},
 				},
 			}, ExecutionTime: int64(2),
-			Skipped: true,
 		},
 	})
 	want := &result.SpecResult{
 		ProtoSpec: &gm.ProtoSpec{
-			PreHookFailures: []*gm.ProtoHookFailure{{StackTrace: "stacktrace"}, {StackTrace: "stacktrace1", TableRowIndex: 1}},
+			PreHookFailures: []*gm.ProtoHookFailure{{StackTrace: "stacktrace"}, {StackTrace: "stacktrace1", TableRowIndex: 1}, {StackTrace: "stacktrace2", TableRowIndex: 2}},
 			SpecHeading:     "heading", FileName: "filename", Tags: []string{"tags"},
-			PostHookFailures: []*gm.ProtoHookFailure{{StackTrace: "stacktrace"}, {StackTrace: "stacktrace1", TableRowIndex: 1}},
 			Items: []*gm.ProtoItem{
-				{ItemType: gm.ProtoItem_Table, Table: &gm.ProtoTable{Headers: &gm.ProtoTableRow{Cells: []string{"a"}}, Rows: []*gm.ProtoTableRow{{Cells: []string{"b"}}, {Cells: []string{"c"}}}}},
-				{ItemType: gm.ProtoItem_Scenario, Scenario: &gm.ProtoScenario{ExecutionStatus: gm.ExecutionStatus_SKIPPED, SkipErrors: []string{"error"}, ScenarioHeading: "scenario Heading1"}},
-				{
-					ItemType: gm.ProtoItem_TableDrivenScenario, TableDrivenScenario: &gm.ProtoTableDrivenScenario{
-						Scenario:      &gm.ProtoScenario{ExecutionStatus: gm.ExecutionStatus_SKIPPED, SkipErrors: []string{"error"}, ScenarioHeading: "scenario Heading2"},
-						TableRowIndex: 0,
-					},
-				},
-				{
-					ItemType: gm.ProtoItem_TableDrivenScenario, TableDrivenScenario: &gm.ProtoTableDrivenScenario{
-						Scenario:      &gm.ProtoScenario{ExecutionStatus: gm.ExecutionStatus_SKIPPED, SkipErrors: []string{"error"}, ScenarioHeading: "scenario Heading2"},
-						TableRowIndex: 1,
-					},
-				},
+				{ItemType: gm.ProtoItem_Table, Table: &gm.ProtoTable{Headers: &gm.ProtoTableRow{Cells: []string{"a"}}, Rows: []*gm.ProtoTableRow{{Cells: []string{"b"}}, {Cells: []string{"d"}}, {Cells: []string{"c"}}}}},
 			}, IsTableDriven: false,
 		},
-		ScenarioCount: 3, ScenarioSkippedCount: 3, ScenarioFailedCount: 0, IsFailed: false, Skipped: true, ExecutionTime: int64(3),
+		ScenarioCount: 0, ScenarioSkippedCount: 0, ScenarioFailedCount: 0, IsFailed: false, Skipped: false, ExecutionTime: int64(5),
 	}
 
 	if !reflect.DeepEqual(got, want) {
@@ -207,116 +199,61 @@ func TestMergeSkippedResults(t *testing.T) {
 	}
 }
 
-func TestMergeParallelTagFiltersExecutionResults(t *testing.T) {
+func TestMergeSkippedResults(t *testing.T) {
 	got := mergeResults([]*result.SpecResult{
 		{
 			ProtoSpec: &gm.ProtoSpec{
-				PreHookFailures: []*gm.ProtoHookFailure{{StackTrace: "pre stacktrace0 for scenario Heading1"}},
 				SpecHeading:     "heading", FileName: "filename", Tags: []string{"tags"},
-				PostHookFailures: []*gm.ProtoHookFailure{{StackTrace: "post stacktrace0 for scenario Heading1"}},
 				Items: []*gm.ProtoItem{
 					{ItemType: gm.ProtoItem_Table, Table: &gm.ProtoTable{Headers: &gm.ProtoTableRow{Cells: []string{"a"}}, Rows: []*gm.ProtoTableRow{{Cells: []string{"b"}}}}},
+					{ItemType: gm.ProtoItem_Scenario, Scenario: &gm.ProtoScenario{ExecutionStatus: gm.ExecutionStatus_SKIPPED, ScenarioHeading: "scenario Heading1", SkipErrors: []string{"error"}}},
 					{
 						ItemType: gm.ProtoItem_TableDrivenScenario, TableDrivenScenario: &gm.ProtoTableDrivenScenario{
-							Scenario:      &gm.ProtoScenario{ExecutionStatus: gm.ExecutionStatus_PASSED, ScenarioHeading: "scenario Heading1"},
+							Scenario:      &gm.ProtoScenario{ExecutionStatus: gm.ExecutionStatus_SKIPPED, ScenarioHeading: "scenario Heading2", SkipErrors: []string{"error"}},
 							TableRowIndex: 0,
 						},
 					},
 				},
 			}, ExecutionTime: int64(1),
+			Skipped: true,
 		},
 		{
 			ProtoSpec: &gm.ProtoSpec{
-				PreHookFailures: []*gm.ProtoHookFailure{{StackTrace: "pre stacktrace1 for scenario Heading1"}},
-				SpecHeading:     "heading", FileName: "filename", Tags: []string{"tags"},
-				PostHookFailures: []*gm.ProtoHookFailure{{StackTrace: "post stacktrace1 for scenario Heading1"}},
-				Items: []*gm.ProtoItem{
-					{ItemType: gm.ProtoItem_Table, Table: &gm.ProtoTable{Headers: &gm.ProtoTableRow{Cells: []string{"a"}}, Rows: []*gm.ProtoTableRow{{Cells: []string{"c"}}}}},
-					{
-						ItemType: gm.ProtoItem_TableDrivenScenario, TableDrivenScenario: &gm.ProtoTableDrivenScenario{
-							Scenario:      &gm.ProtoScenario{ExecutionStatus: gm.ExecutionStatus_PASSED, ScenarioHeading: "scenario Heading1"},
-							TableRowIndex: 1,
-						},
-					},
-				},
-			}, ExecutionTime: int64(1),
-		},
-		{
-			ProtoSpec: &gm.ProtoSpec{
-				PreHookFailures: []*gm.ProtoHookFailure{{StackTrace: "pre stacktrace0 for scenario Heading2"}},
-				SpecHeading:     "heading", FileName: "filename", Tags: []string{"tags"},
-				PostHookFailures: []*gm.ProtoHookFailure{{StackTrace: "post stacktrace0 for scenario Heading2"}},
-				Items: []*gm.ProtoItem{
-					{ItemType: gm.ProtoItem_Table, Table: &gm.ProtoTable{Headers: &gm.ProtoTableRow{Cells: []string{"a"}}, Rows: []*gm.ProtoTableRow{{Cells: []string{"b"}}}}},
-					{
-						ItemType: gm.ProtoItem_TableDrivenScenario, TableDrivenScenario: &gm.ProtoTableDrivenScenario{
-							Scenario:      &gm.ProtoScenario{ExecutionStatus: gm.ExecutionStatus_PASSED, ScenarioHeading: "scenario Heading2"},
-							TableRowIndex: 0,
-						},
-					},
-				},
-			}, ExecutionTime: int64(2),
-		},
-		{
-			ProtoSpec: &gm.ProtoSpec{
-				PreHookFailures: []*gm.ProtoHookFailure{{StackTrace: "pre stacktrace1 for scenario Heading2"}},
 				SpecHeading:     "heading", FileName: "filename", Tags: []string{"tags"},
-				PostHookFailures: []*gm.ProtoHookFailure{{StackTrace: "post stacktrace1 for scenario Heading2"}},
 				Items: []*gm.ProtoItem{
 					{ItemType: gm.ProtoItem_Table, Table: &gm.ProtoTable{Headers: &gm.ProtoTableRow{Cells: []string{"a"}}, Rows: []*gm.ProtoTableRow{{Cells: []string{"c"}}}}},
 					{
 						ItemType: gm.ProtoItem_TableDrivenScenario, TableDrivenScenario: &gm.ProtoTableDrivenScenario{
-							Scenario:      &gm.ProtoScenario{ExecutionStatus: gm.ExecutionStatus_PASSED, ScenarioHeading: "scenario Heading2"},
+							Scenario:      &gm.ProtoScenario{ExecutionStatus: gm.ExecutionStatus_SKIPPED, ScenarioHeading: "scenario Heading2", SkipErrors: []string{"error"}},
 							TableRowIndex: 1,
 						},
 					},
 				},
 			}, ExecutionTime: int64(2),
+			Skipped: true,
 		},
 	})
 	want := &result.SpecResult{
 		ProtoSpec: &gm.ProtoSpec{
-			PreHookFailures: []*gm.ProtoHookFailure{
-				{StackTrace: "pre stacktrace0 for scenario Heading1"},
-				{StackTrace: "pre stacktrace1 for scenario Heading1", TableRowIndex: 1},
-				{StackTrace: "pre stacktrace0 for scenario Heading2"},
-				{StackTrace: "pre stacktrace1 for scenario Heading2", TableRowIndex: 1},
-			},
-			SpecHeading: "heading", FileName: "filename", Tags: []string{"tags"},
-			PostHookFailures: []*gm.ProtoHookFailure{
-				{StackTrace: "post stacktrace0 for scenario Heading1"},
-				{StackTrace: "post stacktrace1 for scenario Heading1", TableRowIndex: 1},
-				{StackTrace: "post stacktrace0 for scenario Heading2"},
-				{StackTrace: "post stacktrace1 for scenario Heading2", TableRowIndex: 1}},
+			SpecHeading:     "heading", FileName: "filename", Tags: []string{"tags"},
 			Items: []*gm.ProtoItem{
 				{ItemType: gm.ProtoItem_Table, Table: &gm.ProtoTable{Headers: &gm.ProtoTableRow{Cells: []string{"a"}}, Rows: []*gm.ProtoTableRow{{Cells: []string{"b"}}, {Cells: []string{"c"}}}}},
+				{ItemType: gm.ProtoItem_Scenario, Scenario: &gm.ProtoScenario{ExecutionStatus: gm.ExecutionStatus_SKIPPED, SkipErrors: []string{"error"}, ScenarioHeading: "scenario Heading1"}},
 				{
 					ItemType: gm.ProtoItem_TableDrivenScenario, TableDrivenScenario: &gm.ProtoTableDrivenScenario{
-						Scenario:      &gm.ProtoScenario{ExecutionStatus: gm.ExecutionStatus_PASSED, ScenarioHeading: "scenario Heading1"},
-						TableRowIndex: 0,
-					},
-				},
-				{
-					ItemType: gm.ProtoItem_TableDrivenScenario, TableDrivenScenario: &gm.ProtoTableDrivenScenario{
-						Scenario:      &gm.ProtoScenario{ExecutionStatus: gm.ExecutionStatus_PASSED, ScenarioHeading: "scenario Heading1"},
-						TableRowIndex: 1,
-					},
-				},
-				{
-					ItemType: gm.ProtoItem_TableDrivenScenario, TableDrivenScenario: &gm.ProtoTableDrivenScenario{
-						Scenario:      &gm.ProtoScenario{ExecutionStatus: gm.ExecutionStatus_PASSED, ScenarioHeading: "scenario Heading2"},
+						Scenario:      &gm.ProtoScenario{ExecutionStatus: gm.ExecutionStatus_SKIPPED, SkipErrors: []string{"error"}, ScenarioHeading: "scenario Heading2"},
 						TableRowIndex: 0,
 					},
 				},
 				{
 					ItemType: gm.ProtoItem_TableDrivenScenario, TableDrivenScenario: &gm.ProtoTableDrivenScenario{
-						Scenario:      &gm.ProtoScenario{ExecutionStatus: gm.ExecutionStatus_PASSED, ScenarioHeading: "scenario Heading2"},
+						Scenario:      &gm.ProtoScenario{ExecutionStatus: gm.ExecutionStatus_SKIPPED, SkipErrors: []string{"error"}, ScenarioHeading: "scenario Heading2"},
 						TableRowIndex: 1,
 					},
 				},
 			}, IsTableDriven: false,
 		},
-		ScenarioCount: 4, ScenarioSkippedCount: 0, ScenarioFailedCount: 0, IsFailed: false, Skipped: false, ExecutionTime: int64(6),
+		ScenarioCount: 3, ScenarioSkippedCount: 3, ScenarioFailedCount: 0, IsFailed: false, Skipped: true, ExecutionTime: int64(3),
 	}
 
 	if !reflect.DeepEqual(got, want) {