Skip to content
Snippets Groups Projects

test/e2e tests

Open Robert Rosca requested to merge test/e2e-tests into master

Description

Adding end to end tests for the calibration pipeline.

Approach is to:

  1. Modify webservice.yaml to be suitable for a test environment
  2. Start up a(n easily killable and ideally trackable by codecov) instance of the webservice server
  3. Start up a ZMQ client with a REQ socket that can send calibration requests and receive replies like MyMdC
  4. Mock calls to slurm (and other stuff) to pretend to be running on Maxwell, but just execute everything directly and return sensible replies (e.g. when 'slurm' submits a job, return a fake job id, check that it is logged)
  5. Select a small subset of data from CALLAB runs to be used for 'quick' tests as part of a PR
  6. Set up nightly runs which run on the entire dataset, and run after a merge is done

How Has This Been Tested?

It is a test :stuck_out_tongue:

Relevant Documents (optional)

N/A

Types of changes

  • Test (additional or refactored tests)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Reviewers

Very WIP so none, I'll write a comment when this is closer to completion

Notes

  • resolved - Still don't have much experience with asyncio, and even less with testing background servers. Looks like a session scoped fixture which starts a process that executes webservice.webservice.main, yields, and then terminates the process afterwards should work. I'm not sure if this will be tracked by codecov though, that isn't too big a priority for this but it would be nice
Edited by Robert Rosca

Merge request reports

Checking pipeline status.

Approval is optional
Ready to merge by members who can write to the target branch.

Merge details

  • The source branch is 2812 commits behind the target branch.
  • 3 commits and 1 merge commit will be added to .
  • Source branch will not be deleted.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Robert Rosca added 25 commits

    added 25 commits

    Compare with previous version

  • Expect a minor delay as I accidentally deleted my work and had not done a push in ages :upside_down:

  • Robert Rosca added 2 commits

    added 2 commits

    Compare with previous version

  • Robert Rosca added 1 commit

    added 1 commit

    • a6f47ae4 - Move MockProposal to top level conftest

    Compare with previous version

  • Robert Rosca added 1 commit

    added 1 commit

    • f38d2f6a - Rename instrument attribute, add detector

    Compare with previous version

  • Robert Rosca added 1 commit

    added 1 commit

    • ccc343cb - Fix accidentally swapped variables

    Compare with previous version

  • Robert Rosca added 1 commit

    added 1 commit

    • d8361336 - Add testpath command mocking

    Compare with previous version

  • Robert Rosca added 1 commit

    added 1 commit

    • 1dcd65af - Commit debugging changes - remember to remove before PR

    Compare with previous version

  • Robert Rosca added 1 commit

    added 1 commit

    Compare with previous version

  • Robert Rosca added 1 commit

    added 1 commit

    • bc38d55b - Minor changes to testing config

    Compare with previous version

  • Robert Rosca added 1 commit

    added 1 commit

    • bc38d55b - Minor changes to testing config

    Compare with previous version

  • Robert Rosca added 1 commit

    added 1 commit

    • 3e7e2482 - Remove loggers before setting up webservice log

    Compare with previous version

  • Robert Rosca added 1 commit

    added 1 commit

    Compare with previous version

  • Robert Rosca added 7 commits

    added 7 commits

    • c52c711d - Mock mymdc update run api method
    • 135220c6 - (try to) Mock python calls
    • 5d72399f - Add todo on exception handling and logging
    • 1e3297a7 - More logs to try and figure out what's happening!
    • 308acb19 - Expand mocked commands
    • cf580e59 - Fix setattr call, use pass mocked python call to
    • 83a6df45 - Replace single with double quotes, use block chomp

    Compare with previous version

  • Robert Rosca
  • Robert Rosca
  • Robert Rosca
  • 23 25 not Path("/gpfs").is_dir() or item.config.getoption("--no-gpfs")
    24 26 ):
    25 27 pytest.skip("gpfs not available")
    28
    29
    30 class MockProposal:
    • @kluyvert should, or could, something like this (a way to create an entire mock proposal directory) go into extra-data? Seems like it might be useful for future tests in extra-data, and it would definitely be useful to have a standard approach here both for our own testing and as a way to let users create their own mock data before a beamtime so they can explore how to develop their analysis tools

      Edit: also, this class has only been moved from another conftest file

      Edited by Robert Rosca
    • Yup, could do. There are a couple of places in EXtra-data where we test with a proposal directory structure. And it probably makes sense for this to live alongside the machinery for creating mock data.

    • Please register or sign in to reply
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading