Skip to content

Conversation

@dw-kihara
Copy link

I discovered the tests were failing because the tests check the contents of certificates, which changes frequently.
To address this, I introduced cacerts_test_data/0 which returns the fixed certificates for testing.

Although cacerts/0 could return the fixed certificats during tests,
I kept it to return the content of priv/cacerts.pem to ensure it provides the correct certificates.

I also modified certifi_pt.erl to transform both functions and to make Dialyzer happy.

Comment on lines 5 to 6
%% Update this when updating priv/cacerts.pem.
-define(NUM_OF_CERTS, 147).
Copy link
Author

Choose a reason for hiding this comment

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

Initially, I thought this number could be generated by parsing priv/cacerts.pem.
However, I realized this approach would weaken the test because parsing the file to verify it is properly parsed sounds somewhat circular.

Copy link
Contributor

Choose a reason for hiding this comment

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

so what do you suggest? I think we should basoically do what you do just testing the module work with fake data. Can you provide an updated patch?

Copy link
Author

Choose a reason for hiding this comment

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

At this point, I left number check of the original test for some reason. Now I also think it was redundant.

@benoitc benoitc self-assigned this Jan 3, 2026
@dw-kihara dw-kihara force-pushed the feature/improve_tests branch from df59570 to f2f94fb Compare January 9, 2026 00:03
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.

2 participants