Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- Tooltip text for Package requirements file for Python autotester settings (#7383)
- Pass back tags and overall comments from Autotester to MarkUs (#7387)
- Render download test result button on assignment summary page only if the assignment has automated testing (#7417)
- Group test results by Test Groups id (#7422)

### 🐛 Bug fixes

Expand Down
13 changes: 10 additions & 3 deletions app/javascript/Components/test_run_table.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,10 @@ class TestGroupResultTable extends React.Component {
let i = 0;
let groups = new Set();
data.forEach(row => {
if (!groups.has(row["test_groups.name"])) {
if (!groups.has(row["test_groups.id"])) {
expanded[i] = {};
i++;
groups.add(row["test_groups.name"]);
groups.add(row["test_groups.id"]);
}
});
return expanded;
Expand All @@ -212,11 +212,18 @@ class TestGroupResultTable extends React.Component {
};

columns = () => [
{
id: "test_group_id",
Header: "",
accessor: row => row["test_groups.id"],
maxWidth: 30,
},
{
id: "test_group_name",
Header: "",
accessor: row => row["test_groups.name"],
maxWidth: 30,
show: false,
},
{
id: "name",
Expand Down Expand Up @@ -337,7 +344,7 @@ class TestGroupResultTable extends React.Component {
className={this.state.loading ? "auto-overflow" : "auto-overflow display-block"}
data={this.state.filteredData}
columns={this.columns()}
pivotBy={["test_group_name"]}
pivotBy={["test_group_id"]}
getTdProps={(state, rowInfo) => {
if (rowInfo) {
let className = `-wrap test-result-${rowInfo.row["test_status"]}`;
Expand Down
2 changes: 1 addition & 1 deletion app/models/grouping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ def self.pluck_test_runs(assoc, filter_output: false, include_extra_info: true)
# doesn't trigger this conversion.
fields = ['test_runs.id', 'test_runs.created_at', 'test_runs.problems', 'test_runs.status',
'roles.type', 'users.user_name',
'test_groups.name', 'test_groups.position', 'test_groups.display_output',
'test_groups.id', 'test_groups.name', 'test_groups.position', 'test_groups.display_output',
'test_group_results.time',
'test_results.name', 'test_results.status as test_results_status', 'test_results.marks_earned',
'test_results.marks_total', 'test_results.output', 'test_results.time', 'test_results.position']
Expand Down