Skip to content

Commit

Permalink
made test_report runnable
Browse files Browse the repository at this point in the history
  • Loading branch information
Yngwarr committed Feb 22, 2024
1 parent a629e43 commit 8ab869e
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 19 deletions.
14 changes: 6 additions & 8 deletions test_report/prepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@ import fhirpath from 'fhirpath'
import fs from 'fs'
import path from 'path'

const CONTENT = '../sof-tests/'
const files = fs.readdirSync(CONTENT)
const CONTENT = '../tests/';
const files = fs.readdirSync(CONTENT);

const allResults = []
await Promise.all(
files.map(async (file) => {
if (path.extname(file) !== '.json') return
let testData
let validate
testData = JSON.parse(fs.readFileSync(CONTENT + file))
allResults.push(testData)
if (path.extname(file) !== '.json') return;
const testData = JSON.parse(fs.readFileSync(CONTENT + file));
allResults.push(testData);
})
)

fs.writeFileSync('public/tests.json', JSON.stringify(allResults, null, " "))
fs.writeFileSync('public/tests.json', JSON.stringify(allResults, null, " "));
1 change: 0 additions & 1 deletion test_report/public/implementations.json

This file was deleted.

29 changes: 29 additions & 0 deletions test_report/public/implementations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[
{
"name": "Ref.Impl",
"url": "https://github.com/FHIR/sql-on-fhir-v2",
"description": "Official reference implementation in JavaScript",
"testResultsUrl": "https://fhir.github.io/sql-on-fhir-v2/test-results.json"
},
{
"name": "Aidbox",
"url": "https://docs.aidbox.app/storage-1/sql-on-fhir",
"description": "FHIR++ Platform by Health Samurai",
"testResultsUrl": "https://storage.googleapis.com/aidbox-public/sof-test-results.json"
},
{
"name": "Google",
"url": "TBD",
"description": "TBD"
},
{
"name": "Pathling",
"url": "TBD",
"description": "TBD"
},
{
"name": "Grahame Impl",
"url": "TBD",
"description": "TBD"
}
]
5 changes: 1 addition & 4 deletions test_report/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,20 @@
export let url = "";
onMount(async function () {
console.log('add location change')
window.addEventListener('hashchange', function(){
hash = window.location.hash.substring(1);
console.log(hash);
})
})
let hash = window.location.hash.substring(1);
console.log(hash);
</script>

<Tailwindcss />

<div class="flex flex-col" style="height: 100%">
<div class="flex space-x-4 px-4 py-1 border-b items-center" style="background-color: rgb(239 253 254);">
<a href="" class="flex items-center px-4">
<a href="" class="flex items-center px-4">
<img src="logo.jpeg" class="w-10 h-10" style="" /> SQL on FHIR 2.0
</a>
<a href="#pg" class="px-2 hover:text-blue-500 hover:bg-gray-150">Playground</a>
Expand Down
3 changes: 0 additions & 3 deletions test_report/src/Impls.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,13 @@
onMount(async function () {
tests = await load('tests.json');
console.log('tests',tests);
var tmp = await load('implementations.json');
for (const impl of tmp) {
if (impl.testResultsUrl){
let res = await load(impl.testResultsUrl);
impl.results = res;
console.log('res', res);
}
}
console.log('impls', tmp);
impls = tmp;
});
Expand Down
1 change: 0 additions & 1 deletion test_report/src/Playground.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
function tabelize(v, results) {
let columns = get_columns(v)
console.log('?',columns);
let rows = []
for( var row of results) {
rows.push(columns.map((k)=>{
Expand Down
2 changes: 0 additions & 2 deletions test_report/src/Tests.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@
onMount(async function () {
menu = await load('tests.json');
impls = await load('implementations.json');
console.log('?', impls);
let hash = window.location.hash.substring(1);
current = menu[0];
menu.forEach((x)=> {
console.log('*',hash, x.file);
if(x.file == hash) {
current = x
};
Expand Down

0 comments on commit 8ab869e

Please sign in to comment.