Skip to content

Commit 37f5589

Browse files
authored
Update website to display new workload and suite changes correctly (#10)
This change has 3 parts: - Updating the gem5 resources schema to now include suites and new changes to the workloads JSON object. - Fixing a bug that was introduced due to the change made to workloads where new workloads with the new JSON format were not displayed on the website. - Updating the tests that would fail due to addition on the new category "suite".
2 parents 0f8400f + 7bdc5a4 commit 37f5589

File tree

7 files changed

+1146
-447
lines changed

7 files changed

+1146
-447
lines changed

__tests__/pages/category/index.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ describe('Category component', () => {
3838
const categoryTitle = screen.getByText('Categories');
3939
expect(categoryTitle).toBeInTheDocument();
4040
let cards = screen.queryAllByLabelText('card');
41-
expect(cards).toHaveLength(14);
41+
expect(cards).toHaveLength(15);
4242
});
4343
});
4444

components/resourceMetadata.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,15 @@ export default function MetaData({ resource, className, metaFields, showMetadata
119119
<div>
120120
{key.charAt(0).toUpperCase() + key.slice(1)}
121121
</div>
122-
<a href={process.env.BASE_PATH + '/resources/' + resource.resources[key] + `?database=${resource.database}`} style={{ display: 'block', paddingTop: '0.0625rem' }}>
123-
{resource.resources[key]}
124-
</a>
122+
{typeof(resource.resources[key]) == 'string' ?
123+
<a href={process.env.BASE_PATH + '/resources/' + resource.resources[key] + `?database=${resource.database}`} style={{ display: 'block', paddingTop: '0.0625rem' }}>
124+
{resource.resources[key]}
125+
</a>
126+
:
127+
<a href={process.env.BASE_PATH + '/resources/' + resource.resources[key]["id"] + `?database=${resource.database}&version=${resource.resources[key]["resource_version"]}`} style={{ display: 'block', paddingTop: '0.0625rem' }}>
128+
{resource.resources[key]["id"]}
129+
</a>
130+
}
125131
</div>
126132
);
127133
})

cypress/fixtures/schema.json

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"simpoint-directory",
2121
"resource",
2222
"looppoint-pinpoint-csv",
23-
"looppoint-json"
23+
"looppoint-json",
24+
"suite"
2425
],
2526
"description": "The category of the resource",
2627
"default": "resource"
@@ -189,7 +190,11 @@
189190
},
190191
{
191192
"$ref": "#/definitions/workload"
193+
},
194+
{
195+
"$ref": "#/definitions/suite"
192196
}
197+
193198
],
194199
"definitions": {
195200
"architecture": {
@@ -236,7 +241,18 @@
236241
},
237242
"resources": {
238243
"type": "object",
239-
"description": "A dictionary of resources that are required to run the workload",
244+
"description": "An dictionary of resources that are required to run the workload",
245+
"items": {
246+
"type": "object",
247+
"properties": {
248+
"id": {
249+
"type": "string"
250+
},
251+
"resoruce-version": {
252+
"type": "string"
253+
}
254+
}
255+
},
240256
"default": {}
241257
}
242258
},
@@ -526,6 +542,38 @@
526542
"$ref": "#/definitions/abstract-file"
527543
}
528544
]
545+
},
546+
"suite" : {
547+
"description": "A collection of workloads.",
548+
"properties" : {
549+
"category": {
550+
"type": "string",
551+
"const": "suite"
552+
},
553+
"workloads": {
554+
"type": "array",
555+
"items": {
556+
"type": "object",
557+
"properties": {
558+
"id": {
559+
"type": "string"
560+
},
561+
"resource-version": {
562+
"type": "string"
563+
},
564+
"input-group" : {
565+
"type": "array",
566+
"items": {
567+
"type": "string"
568+
}
569+
}
570+
}
571+
}
572+
}
573+
},
574+
"required": [
575+
"workloads"
576+
]
529577
}
530578
}
531579
}

0 commit comments

Comments
 (0)