Ticket #2504 (closed: fixed)

Opened 10 years ago

Last modified 5 years ago

Update the ICat tests so they don't rely on the real server

Reported by: Russell Taylor Owned by: Janik Zikovsky
Priority: minor Milestone: Release 2.0
Component: Infrastructure Keywords:
Cc: Blocked By:
Blocking: Tester: Russell Taylor

Description

The ICat tests are about the slowest unit tests we have, and of course rely on the RAL ICat server and network to it.

We should mock/stub the server and use that for the tests instead.

Change History

comment:1 Changed 9 years ago by Nick Draper

  • Status changed from new to assigned
  • Priority changed from major to minor
  • Owner set to Martyn Gigg

comment:2 Changed 9 years ago by Nick Draper

  • Milestone changed from Iteration 28 to Iteration 29

Bulk move of tickets at the end of iteration 28

comment:3 Changed 9 years ago by Nick Draper

  • Milestone changed from Iteration 29 to Iteration 30

Accepted and assigned tickets moved at iteration 29 code freeze

comment:4 Changed 9 years ago by Nick Draper

  • Milestone changed from Iteration 30 to Iteration 31

Bulk move of tickets to iteration 31 at the iteration 30 code freeze

comment:5 Changed 9 years ago by Russell Taylor

Having just received a bunch of Jenkins emails because the ISIS network was down, I thought I'd write down my thoughts on how to sort this (maybe I'll get a chance to do it myself one day).

I don't think the likely amount of work in stubbing the web service is really worth it. I think instead we should make use of the 'skipped test' concept (as has been put into the system tests). A test could check if the server is there at the start and, if not, mark the whole test suite as skipped. We'd probably have to make modifications to the cxxtest code, but we've already forked that. We could possible hi-jack the TS_WARN macro, which we don't use anywhere and leads to a different exit code.

comment:6 Changed 9 years ago by Janik Zikovsky

  • Owner changed from Martyn Gigg to Janik Zikovsky
  • Status changed from assigned to accepted

Having messed with CXX test and with ICat down today, I'll give it a shot.

comment:7 Changed 9 years ago by Janik Zikovsky

Refs #2504: Try skipping ICatTests when cannot contact the server

Extended Cxx test TestSuite to have a skipTests() method. Using the ICat Login algorithm to test the connection. There is probably a better way (this is a little slow).

Changeset: cc81a7c6a94884d4f874743aeeb1cd451dddb32a

comment:8 Changed 9 years ago by Janik Zikovsky

Refs #2504: Fix mac/win test build?

Changeset: 4934afbc80987343861e32a90178faca5678b9df

comment:9 Changed 9 years ago by Janik Zikovsky

Refs #2504: Fix win test build?

Changeset: 35c35dedd7e20fdfad7cefec2b6dbb2e7190374d

comment:10 Changed 9 years ago by Janik Zikovsky

Refs #2504: Fix win test build again?

Changeset: b37934a8899725f778f209fe9e7806be04faf66e

comment:11 Changed 9 years ago by Janik Zikovsky

Refs #2504: Fix win test build 3: The Revenge

Changeset: a7d547f8b8d26cabd21b1d4d57625050cbcd6dad

comment:12 Changed 9 years ago by Janik Zikovsky

  • Status changed from accepted to verify
  • Resolution set to fixed

Would it be a good idea to replace the skipTests() method in ICatTestHelper with something that directly checks the server? Right now it takes ~20 seconds for Login to fail, and it might hang?

Otherwise, this seems to fix the problem since the ICat servers are down today but we can keep working.

comment:13 Changed 9 years ago by Russell Taylor

  • Status changed from verify to verifying
  • Tester set to Russell Taylor

comment:14 Changed 9 years ago by Russell Taylor

  • Status changed from verifying to closed

Tested this by pulling out my network cable! All tests pass except CatalogDownloadDataFilesTest - because it goes off to another server to test getting a file. I.e. We are insulated against the ICat server being down but not against a local (or RAL-wide) network failure.

I'm happy to close this, but I've created ticket #4479 to tidy things up a bit more (including implementing comment 12 above.

comment:15 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 3351

Note: See TracTickets for help on using tickets.