Skip to content

Commit

Permalink
Update website to display new workload and suite changes correctly (
Browse files Browse the repository at this point in the history
#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".
  • Loading branch information
BobbyRBruce authored Jan 25, 2024
2 parents 0f8400f + 7bdc5a4 commit 37f5589
Show file tree
Hide file tree
Showing 7 changed files with 1,146 additions and 447 deletions.
2 changes: 1 addition & 1 deletion __tests__/pages/category/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('Category component', () => {
const categoryTitle = screen.getByText('Categories');
expect(categoryTitle).toBeInTheDocument();
let cards = screen.queryAllByLabelText('card');
expect(cards).toHaveLength(14);
expect(cards).toHaveLength(15);
});
});

Expand Down
12 changes: 9 additions & 3 deletions components/resourceMetadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,15 @@ export default function MetaData({ resource, className, metaFields, showMetadata
<div>
{key.charAt(0).toUpperCase() + key.slice(1)}
</div>
<a href={process.env.BASE_PATH + '/resources/' + resource.resources[key] + `?database=${resource.database}`} style={{ display: 'block', paddingTop: '0.0625rem' }}>
{resource.resources[key]}
</a>
{typeof(resource.resources[key]) == 'string' ?
<a href={process.env.BASE_PATH + '/resources/' + resource.resources[key] + `?database=${resource.database}`} style={{ display: 'block', paddingTop: '0.0625rem' }}>
{resource.resources[key]}
</a>
:
<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' }}>
{resource.resources[key]["id"]}
</a>
}
</div>
);
})
Expand Down
52 changes: 50 additions & 2 deletions cypress/fixtures/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"simpoint-directory",
"resource",
"looppoint-pinpoint-csv",
"looppoint-json"
"looppoint-json",
"suite"
],
"description": "The category of the resource",
"default": "resource"
Expand Down Expand Up @@ -189,7 +190,11 @@
},
{
"$ref": "#/definitions/workload"
},
{
"$ref": "#/definitions/suite"
}

],
"definitions": {
"architecture": {
Expand Down Expand Up @@ -236,7 +241,18 @@
},
"resources": {
"type": "object",
"description": "A dictionary of resources that are required to run the workload",
"description": "An dictionary of resources that are required to run the workload",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"resoruce-version": {
"type": "string"
}
}
},
"default": {}
}
},
Expand Down Expand Up @@ -526,6 +542,38 @@
"$ref": "#/definitions/abstract-file"
}
]
},
"suite" : {
"description": "A collection of workloads.",
"properties" : {
"category": {
"type": "string",
"const": "suite"
},
"workloads": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"resource-version": {
"type": "string"
},
"input-group" : {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
},
"required": [
"workloads"
]
}
}
}
Loading

0 comments on commit 37f5589

Please sign in to comment.