Skip to content

Conversation

@kingthorin
Copy link
Collaborator

@kingthorin kingthorin commented Jun 1, 2024

Following the failure here: https://github.com/datafaker-net/datafaker/actions/runs/9324424830/job/25669623466#step:4:1

Which apparently only had a 1 in 4037 chance of happening on any given test run, lucky us 😀

I threw together this temporary test (I'm sure there are more elegant ways to do this, it was just a quick thing):

@Test
void checkLengths() {
	List<String> entries = getBaseList("aviation.airport");
	System.out.println(entries.size());
	Map<Integer, Integer> lenMap = new HashMap<>();
	lenMap.put(1, 0);
	lenMap.put(2, 0);
	lenMap.put(3, 0);
	lenMap.put(4, 0);
	lenMap.put(5, 0);
	lenMap.put(6, 0);
	for (String entry : entries) {
		Integer count = lenMap.get(entry.length());
		count++;
		lenMap.put(entry.length(), count);
		if (entry.length() != 4) {
			System.out.println(entry);
		}
	}
	System.out.println(lenMap);
}

Which produced:

4037
N55
{1=0, 2=0, 3=1, 4=4036, 5=0, 6=0}

Indeed N55 is a valid airport: https://www.google.com/search?q=N55+airport - Jaluit Airport

So I've adjusted the regex in the test to allow length 3 or 4.

Signed-off-by: kingthorin <kingthorin@users.noreply.github.com>
@codecov-commenter
Copy link

codecov-commenter commented Jun 1, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.03%. Comparing base (b37c566) to head (ad08e81).
Report is 637 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1241      +/-   ##
============================================
- Coverage     92.35%   92.03%   -0.32%     
- Complexity     2821     3042     +221     
============================================
  Files           292      309      +17     
  Lines          5609     5987     +378     
  Branches        599      629      +30     
============================================
+ Hits           5180     5510     +330     
- Misses          275      319      +44     
- Partials        154      158       +4     

☔ View full report in Codecov by Sentry.
📢 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.

@kingthorin kingthorin merged commit 9ee5a4e into datafaker-net:main Jun 1, 2024
@kingthorin kingthorin deleted the fix-aviation-test branch June 1, 2024 12:09
@bodiam bodiam mentioned this pull request Jun 1, 2024
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.

4 participants