Skip to content
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

Test documentation and failing slow running tests #100

Closed
olivecha opened this issue Jul 29, 2024 · 5 comments
Closed

Test documentation and failing slow running tests #100

olivecha opened this issue Jul 29, 2024 · 5 comments
Assignees

Comments

@olivecha
Copy link

First, a small paragraph on how users can run the tests with pytest and what the machine requirements are (cuda), with a mention of the --runslow option would be expected in the README.

I was able to run the "fast" tests with success, but I encountered errors with the slow running tests.

  • The test_field_divergence test fails due to missing cuda device (expected), but perhaps the test could be skipped in the absence of an available cuda device.
  • The test_nnparams_load_trained_TAUNET and test_nnparams_load_trained_CUSTOMMLP fail because the object OnePointSpectraDataGenerator is instantiated without the zref argument:
    @pytest.mark.slow
    def test_nnparams_load_trained_CUSTOMMLP():
        pb = CalibrationProblem(
            nn_params=NNParameters(
                nlayers=2, hidden_layer_sizes=[10, 10], activations=[nn.GELU(), nn.ReLU()]
            ),
            prob_params=ProblemParameters(
                nepochs=2, eddy_lifetime=EddyLifetimeType.CUSTOMMLP
            ),
            loss_params=LossParameters(alpha_pen2=1.0, alpha_pen1=1.0e-5, beta_reg=2e-4),
            phys_params=PhysicalParameters(L=L, Gamma=Gamma, sigma=sigma, domain=domain),
            device=device,
        )
    
        k1_data_pts = domain
        DataPoints = [(k1, 1) for k1 in k1_data_pts]
    
>       Data = OnePointSpectraDataGenerator(data_points=DataPoints).Data
E       TypeError: OnePointSpectraDataGenerator.__init__() missing 1 required positional argument: 'zref'

test/io/test_model_params.py:123: TypeError

Please clarify if this is the expected behaviour.

@olivecha
Copy link
Author

I saw that the slow running tests are not run on each commit, so maybe that's the issue...

@mdmeeker
Copy link
Collaborator

mdmeeker commented Aug 4, 2024

Hi. These have been fixed in #103 and the slow tests are now run on all push/pull-request to main.

@olivecha
Copy link
Author

olivecha commented Aug 6, 2024

Could you just add that --runslow is a pytest option in the development installation instructions, so users who want to run the tests don't have to go read the test code to figure this out ?

@mdmeeker
Copy link
Collaborator

mdmeeker commented Aug 7, 2024

There's now a note under Running Tests Locally for this.

@olivecha
Copy link
Author

olivecha commented Aug 9, 2024

Good !

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

No branches or pull requests

2 participants