Skip to content

Commit

Permalink
[refactor] Disable logs, add test run cmd to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
amivanoff committed Jul 29, 2024
1 parent 27c003b commit ceed638
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 16 deletions.
39 changes: 30 additions & 9 deletions docs/Testcases Overall Structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,36 @@ Suitable for quick test-based diagnostics in case you have many errors from seve

The list blow is sorted from simple unit tests to more and more complex integration tests (i.e. complexity increases):

- Without SPARQL Generation
- SparqlClientUpload.spec.ts -- REST rdf file upload
- SparqlClient.spec.ts -- namespaces and basic SPARQL Select with RDFS and DT reasoners
## Without SPARQL Generation
DONE SparqlClientUpload.spec.ts -- REST rdf file upload
```bash
yarn test SparqlClientUpload.spec.ts
```
SparqlClient.spec.ts -- namespaces and basic SPARQL Select with RDFS and DT reasoners
```bash
yarn test SparqlClient.spec.ts
```

- With SPARQL Generation
- SparqlGen.spec.ts -- without: mobx, client-server I/O
- ArtifactShapeSchema.spec.ts -- initial shapes, server shapes (simple parentless and with inheritance)
- SimpleRetrieve.spec.ts -- upload all example files and all kind of selects with different conditions
- Artifact.spec.ts -- Entity deletion and creation
- ArtifactsInModule.spec.ts
## With SPARQL Generation
SparqlGen.spec.ts -- without: mobx, client-server I/O
```bash
yarn test SparqlGen.spec.ts
```
ArtifactShapeSchema.spec.ts -- initial shapes, server shapes (simple parentless and with inheritance)
```bash
yarn test ArtifactShapeSchema.spec.ts
```
SimpleRetrieve.spec.ts -- upload all example files and all kind of selects with different conditions
```bash
yarn test SimpleRetrieve.spec.ts
```
Artifact.spec.ts -- Entity deletion and creation
```bash
yarn test Artifact.spec.ts
```
ArtifactsInModule.spec.ts
```bash
yarn test ArtifactsInModule.spec.ts
```

In case of errors we recommend to check and fix errors in this order.
14 changes: 7 additions & 7 deletions src/models/MstColl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,13 @@ export const MstColl = types
//console.log('loadColl isLoading=true, Skip');
return;
}
console.log('loadColl START');
//console.log('loadColl START');
self.isLoading = true;
if (self.collConstr) {
const collConstr = getSnapshot<ICollConstrSnapshotOut>(self.collConstr);
let parent: any | undefined = self.collConstr['@parent'];
if (parent) parent = getSnapshot<ICollConstrSnapshotOut>(parent);
console.log('loadColl query', { collConstr, parent });
//console.log('loadColl query', { collConstr, parent });
try {
const objects: JsObject[] | null = yield constructObjectsSnapshot(
collConstr,
Expand All @@ -269,16 +269,16 @@ export const MstColl = types
console.warn('loadColl: self.collConstr is undefined');
}
if (self.isLoading) self.isLoading = false;
console.log('loadColl END');
//console.log('loadColl END');
}),

loadMore: flow(function* loadMore() {
// do not mess with other loading process in this coll
if (self.isLoading) {
console.log('loadMore isLoading=true, Skip');
//console.log('loadMore isLoading=true, Skip');
return;
}
console.log('loadMore START');
//console.log('loadMore START');
self.isLoading = true;
if (self.collConstr) {
const collConstr = {
Expand All @@ -288,7 +288,7 @@ export const MstColl = types
};
let parent: any = self.collConstr['@parent'];
if (parent) parent = getSnapshot<ICollConstrSnapshotOut>(parent);
console.log('loadMore query', { collConstr, parent });
//console.log('loadMore query', { collConstr, parent });
try {
const objects: JsObject[] | null = yield constructObjectsSnapshot(
collConstr,
Expand Down Expand Up @@ -317,7 +317,7 @@ export const MstColl = types
console.warn('loadMore: self.collConstr is undefined');
}
if (self.isLoading) self.isLoading = false;
console.log('loadMore END');
//console.log('loadMore END');
}),

changeCollConstr(constr: any) {},
Expand Down

0 comments on commit ceed638

Please sign in to comment.