Monday, July 8, 2019

PSF GSoC students blogs: Seventh Week [July 1st - July 7th] [3rd PSF Blog Post]

This session, we set up azure testing pipelines for "Carsus ... a TARDIS support package for creating and working with atomic datasets" (Carsus Documentation). This repository is intended to complement github.com/tardis-sn/tardis. The pipeline is much more advanced, as it runs 5 parallel tests, a simple basic pytest, one that uses remote data, one that runs slowly, one that fetches database info, and one that adds coverage results: Coverage results. (Hopefully we will get the covered files up to above 80 percent). We use pytest for these tests, and run the commands usings the Carsus setup module's arguments. I learned three new things about azure making this new pipeline. The first is how to efficiently use key value pairs to activate different environments for each test:


Environment 1:

variable = test

Environment 2:

variable = test --remote-data

script:

python setup.py variable

... Running two tests for Environment 1 and 2

 

With updated documentation here: (Most Up To Date Tardis Documentation). I also learned how to use azure's conditioning statements, which includes verifications on environmental variables. This can thus be used to assign script in the pipeline to run for specific environments, and we have to use this, if, condition for the remote data environment. I also figured out how to use (Azure's publishing Task) to generate an appealing coverage report that is readily viewable on the Azure website after the test succeeds. The main issue was generating the compatible xml file. 

I was able to solve the recursion problem I mentioned last week that seemed to be caused by astropy_helpers that is very simliar to this Python recursion error. The problem was that the Carsus repository did not have an updated configuration file (ah_bootsrap.py) for the newer version of astropy_helpers, which caused an infitie loop between the abc and typing modules for sphinx versions above 1.5.6. It seems that there is still a lot to do for the Carsus repository to fully make it python3 compatible. Since I am learning how to make everything python3 compatible, this gives me a chance to learn general overall python coding, instead of specific implementations. 

Since the building documentation pipeline requires sphinx to be above 1.6 in a python 3 enviornment, we will withold on merging the Build documentation pipeline pr, which changes the sphinx version and adds the necessary content to setup a pipeline on azure. 

Learning Highlights:

  • Effecient use of key value paris in different parralel jobs
  • Azure's built-in conditioning statements
  • Publishing coverage results
  • Astropy_helpers 
  • General Python
 


from Planet Python
via read more

No comments:

Post a Comment

TestDriven.io: Working with Static and Media Files in Django

This article looks at how to work with static and media files in a Django project, locally and in production. from Planet Python via read...