Skip to content

[dev] Add mock accessioning server - #5995

Open
StephenHulme wants to merge 1 commit into
developfrom
sh51/add-accessioning-simulator
Open

StephenHulme wants to merge 1 commit into
developfrom
sh51/add-accessioning-simulator

Conversation

@StephenHulme

@StephenHulme StephenHulme commented Aug 18, 2026 •

Copy link
Copy Markdown
Member

A vanilla Python implementation of a the ENA accessioning service for development and testing purposes.

  • Can be set to always fail, always succeed, or to succeed or fail with random HTTP status codes
  • Specifically developed to work with the ENA Webin REST V1 API, a version 2 is recommended for new projects
  • Displays the sent payloads for debugging
  • Works out the box with Sequencescape's development config: python mock_accessioning_server.py

Usage example:

$ python mock_accessioning_server.py --always-succeed
Mock accession server running
  (configured to always succeed)
Listening on http://localhost:9999

--- Incoming Request ---
Path: /accession_service/
Headers:
  User-Agent: Sequencescape Accessioning V1 Client
  Content-Type: multipart/form-data; boundary=-----------RubyMultipartPost-a4c26aa3f520b5b8c9b83a1b23a9691c
  Content-Length: 1781
  Authorization: Basic ZXJhX2FjY2Vzc2lvbl9sb2dpbjplcmFfYWNjZXNzaW9uX3Bhc3N3b3Jk
  Accept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
  Accept: */*
  Host: localhost:9999
Body:
-------------RubyMultipartPost-a4c26aa3f520b5b8c9b83a1b23a9691c
Content-Disposition: form-data; name="SUBMISSION"; filename="da4021c2-3a5b-11f1-8097-060cfcc4e09f-2026-08-18T124819Z.submission.xml"
Content-Length: 413
Content-Type: text/plain
Content-Transfer-Encoding: binary

<?xml version="1.0" encoding="UTF-8"?><SUBMISSION xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" center_name="SC" broker_name="" alias="da4021c2-3a5b-11f1-8097-060cfcc4e09f-2026-08-18T12:48:19Z" submission_date="2026-08-18T12:48:19Z"><ACTIONS><ACTION><ADD source="da4021c2-3a5b-11f1-8097-060cfcc4e09f-2026-08-18T124819Z.sample.xml" schema="sample"/></ACTION><ACTION><HOLD/></ACTION></ACTIONS></SUBMISSION>

-------------RubyMultipartPost-a4c26aa3f520b5b8c9b83a1b23a9691c
Content-Disposition: form-data; name="SAMPLE"; filename="da4021c2-3a5b-11f1-8097-060cfcc4e09f-2026-08-18T124819Z.sample.xml"
Content-Length: 739
Content-Type: text/plain
Content-Transfer-Encoding: binary

<?xml version="1.0" encoding="UTF-8"?><SAMPLE_SET xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SAMPLE alias="da4021c2-3a5b-11f1-8097-060cfcc4e09f"><TITLE>sample_1_SQPD-9873_B1</TITLE><SAMPLE_NAME><TAXON_ID>9606</TAXON_ID><COMMON_NAME>Homo sapiens</COMMON_NAME></SAMPLE_NAME><SAMPLE_ATTRIBUTES><SAMPLE_ATTRIBUTE><TAG>geographic location (country and/or sea)</TAG><VALUE>not provided</VALUE></SAMPLE_ATTRIBUTE><SAMPLE_ATTRIBUTE><TAG>collection date</TAG><VALUE>not provided</VALUE></SAMPLE_ATTRIBUTE><SAMPLE_ATTRIBUTE><TAG>sample description</TAG><VALUE>SD-SQPD-9873</VALUE></SAMPLE_ATTRIBUTE><SAMPLE_ATTRIBUTE><TAG>ArrayExpress-SPECIES</TAG><VALUE>Homo sapiens</VALUE></SAMPLE_ATTRIBUTE></SAMPLE_ATTRIBUTES></SAMPLE></SAMPLE_SET>

-------------RubyMultipartPost-a4c26aa3f520b5b8c9b83a1b23a9691c--

-----------------------

127.0.0.1 - - [18/Aug/2026 13:48:19] "POST /accession_service/ HTTP/1.1" 200 -

Changes proposed in this pull request

  • Add a local accessioning server for development use

TODO: decide which directory it should live in - or if the repository root is fine.

Instructions for Reviewers

[All PRs] - Confirm PR template filled
[Feature Branches] - Review code
[Production Merges to main]
    - Check story numbers included
    - Check for debug code
    - Check version

@StephenHulme StephenHulme added the Accessioning Epic in technical roadmap June 2025, relating to improving the accessioning code. label Aug 18, 2026
@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.67%. Comparing base (ebb6588) to head (8e87dac).
⚠️ Report is 7 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5995      +/-   ##
===========================================
- Coverage    83.71%   83.67%   -0.04%     
===========================================
  Files         1286     1286              
  Lines        31601    31605       +4     
  Branches      3492     3492              
===========================================
- Hits         26455    26446       -9     
- Misses        4332     4341       +9     
- Partials       814      818       +4     
Flag Coverage Δ
javascript 85.29% <ø> (ø)
ruby 83.53% <ø> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Accessioning Epic in technical roadmap June 2025, relating to improving the accessioning code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant