if there is a TEST_ID in the ENV, upload the logs to the given test

Otherwise assume old cgi-bin interface