Skip to content

Add test automation for miscellaneous sample and sample type issues. #2491

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 17 commits into
base: develop
Choose a base branch
from

Conversation

labkey-danield
Copy link
Contributor

@labkey-danield labkey-danield commented Jun 13, 2025

Rationale

Updating shared test components to aid with the test automation identified in the related PR.

Related Pull Requests

Changes

  • Update EntityTypeDesigner.setParentAlias to take an optional parameter that will set a parent as required.
  • Update SampleTypeNameExpressionTest. testWithTrickyFieldNames to use all the tricky characters for a name expression.
  • Updated TestDataGenerator to have REALISTIC_DOMAIN_NAMES
  • Update TestDataGenerator.getRealisticDomainName to take an optional exclusion list (just to avoid duplicate name collisions).
  • Removed deprecated method SampleTypeAPIHelper.getSampleIdFromName (and the 2 or 3 calls to it).

StringBuilder sbNameExpression = new StringBuilder();

// Covers Issue 52180
String parentsampleTypeEncoded = PARENT_SAMPLE_TYPE.replace("/", "\\/");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this what PARENT_SAMPLE_TYPE_INPUT is for?

Comment on lines +76 to +77
private static final String DEFAULT_SAMPLE_PARENT_VALUE = "SS" +
EscapeUtil.escapeForNameExpression(TestDataGenerator.randomString(3).replaceAll("[_)]", ".")); // '_' is used as delimiter to get batchRandomId and ) is used to close the defaultValue()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I was messing with this test, escaping didn't seem to work for default values. The backslashes just ended up being part of the default value. If escaping worked, you should be able to not exclude _ and ) from the value.


checker().verifyTrue("Name of derived sample doesn't look correct. Should contain 'Parent Sample'.",
derivedSampleName.contains("Parent Sample"));
checker().verifyTrue("Name of derived sample doesn't look correct. Should contain 'tricky06'.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of 'tricky06' is a little magical here. Perhaps capture this in a constant somewhere like PARENT_FIELD_VALUE_PREFIX = "tricky06"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants