Pages

Sunday, March 12, 2023

BridgeDb NWO grant update #7: wrapping up the project

I have received the request to write up the final reporting and the paid practical work has been completed (we already said goodbye to Helena almost a month ago). After the hackathon last month, we released BridgeDb Webservice 2.1.0 and actually had this online for about a week.


Unfortunately, this week we ran into a few regressions and I restored the previous version, solving those issues. Issues were created and solved this week(-end), resulting in the 2.1.1 release

Along the fixing, tests were created for the problems along with tests for other API methods. This was interesting in itself, because it requires firing up a BridgeDb Webservice in the background and actually load a Derby file (we need some data to test for). Firing up the webservice is one thing (I'm just hoping the port is open when the test runs), but we also need to create two temporary files. One is the gdb.config which points to the Derby file and the Derby file itself. But both are distributed in java archive files (JARs) so need to be saved to a temporary file first. That was doable :)

    public static void startServer() throws IOException {
        // set up a test Derby file
        File derbyFile = File.createTempFile("bdb", "bridge");
        derbyFile.deleteOnExit();
        InputStream stream = RestletServerTest.class.getClassLoader().getResourceAsStream("humancorona-2021-11-27.bridge");
        FileOutputStream derbyStream = new FileOutputStream(derbyFile);
        stream.transferTo(derbyStream);
        derbyStream.close();
        stream.close();

        // set up the GDB config file
        File configFile = File.createTempFile("gdb", "config");
        configFile.deleteOnExit();
        FileOutputStream outputStream = new FileOutputStream(configFile);
        BufferedOutputStream bufferStream = new BufferedOutputStream(outputStream);
        String configFileContent = "*\t" +  derbyFile.getAbsolutePath();
        bufferStream.write(configFileContent.getBytes());
        bufferStream.close();
        outputStream.close();

        // set up the REST service
        RestletServerTest.server = new RestletServer();
        RestletServerTest.server.run(port, configFile, false, false);
    }
During the grant, one task was to set up better testing. We did, but for the new webservice, this was not put in place yet. Particularly, the code coverage of the testing was not set up. That I did this week using the CodeCov services which are free for open source projects. That gives these results:


There clearly is work left to be done. The current testing focuses on the common functionality and the new (alpha) JSON functionality is mostly not tested yet. This will change in the next few weeks.

So, that leaves the reporting and writing the journal article. And cleaning up the lab, of course.

Previous updates

No comments:

Post a Comment