Skip to content

Commit

Permalink
ttools: taplint reports I[nfo] not F[ail] for missing ObsCore
Browse files Browse the repository at this point in the history
  • Loading branch information
mbtaylor authored and mmpcn committed Nov 27, 2014
1 parent a9ca3da commit eb173f4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
2 changes: 2 additions & 0 deletions ttools/src/docs/sun256.xml
Expand Up @@ -8545,6 +8545,8 @@ eds. C. Gabriel et al., ASP Conf. Ser. 351, p. 666 (2006)
report for BOOLEAN/boolean declared/returned data.</li>
<li><code>taplint</code> now takes steps to ensure that TAP_SCHEMA
column list query is not truncated.</li>
<li><code>taplint</code> now flags absence of ObsCore table with
I[nfo] not F[ailure] status.</li>
</ul>
</p></dd>

Expand Down
27 changes: 22 additions & 5 deletions ttools/src/main/uk/ac/starlink/ttools/taplint/ObsTapStage.java
Expand Up @@ -60,15 +60,22 @@ public String getDescription() {
public void run( Reporter reporter, URL serviceUrl ) {

/* Check prerequisites. */
boolean obsDeclared;
TapCapability tcap = capHolder_.getCapability();
if ( tcap != null ) {
if ( ! hasObscoreDm( reporter, tcap ) ) {
reporter.report( ReportType.FAILURE, "NODM",
if ( hasObscoreDm( reporter, tcap ) ) {
obsDeclared = true;
}
else {
reporter.report( ReportType.INFO, "NODM",
"Table capabilities lists no DataModel "
+ OBSCORE_ID );
+ OBSCORE_ID + " - no ObsCore tests" );
return;
}
}
else {
obsDeclared = false;
}
TableMeta[] tmetas = metaHolder_.getTableMetadata();
if ( tmetas == null ) {
reporter.report( ReportType.FAILURE, "NOTM",
Expand All @@ -86,8 +93,18 @@ public void run( Reporter reporter, URL serviceUrl ) {
}
}
if ( obsMeta == null ) {
reporter.report( ReportType.FAILURE, "NOTB",
"No table with name " + OBSCORE_TNAME );
String missingMsg = "No table with name " + OBSCORE_TNAME;
if ( obsDeclared ) {
reporter.report( ReportType.FAILURE, "NOTB", missingMsg );
}
else {
reporter.report( ReportType.INFO, "OCCP",
missingMsg
+ "; probably just means no ObsCore intended"
+ " but can't tell for sure"
+ " because no capabilities present"
+ " (earlier stages failed/skipped?)" );
}
return;
}

Expand Down

0 comments on commit eb173f4

Please sign in to comment.