开源软件名称:mikeizbicki/continuous-integration开源软件地址:https://github.com/mikeizbicki/continuous-integration开源编程语言:Python 100.0%开源软件介绍:Continuous IntegrationThis is the first homework assignment for Claremont McKenna's CSCI46: Data Structures course and CSCI143: Big Data course. Continuous Integration (CI) is a technique for proving that your code is correct. CI tools run your code's test cases automatically when you commit code to your repo, and let you know if anything is broken. In this class, we will be using GitHub Actions for CI. It is a standard tool used by many open source applications in order to maintain code quality. Whenever you submit a pull request to an open source project, it will have to pass the CI tests in order for the maintainer to accept your changes. This process ensures that thousands of developers can work together on the same project without breaking each other's code. All of your homework grades in this class will be determined by the results of the CI tests. If you pass all the tests, you get full credit. For each test case that you fail, you will lose 1 point on the assignment. The workflow is summarized in the following diagram: In this assignment, you will create a sample project that uses CI to run some simple tests. There is very little coding in this assignment, and the purpose is to ensure that you understand the mechanics of how to get CI running correctly. InstructionsFork this repo, and clone your fork onto the lambda server.
Running the test casesThis project uses the
You should get output similar to
This message tells us that there are currently 6 failing test cases. Fix these test cases by editing the python file Once you've made your changes, rerun the doctest command
If everything is working correctly, then the command should have no output. This means that you are passing all the tests. NOTE: On all your assignments in this class, you will lost 1 point for each test case that is not passing. Running the linterA linter is a program that enforces style constraints on code. When many programmers collaborate on a project, it becomes much easier if they all use the same style. For example, how to name variables is a common style issue.
Some programmers use what's called camel case to name variables.
For example, Python has a large set of these style rules that "true" python programmers follow. These rules are codified in PEP8, which was introduced by Python's Benevolent Dictator For Life (BDFL) Guido van Rossum. PEP stands for Python Enhancement Proposal, and it's the 8th such proposal that's been accepted. There are currently hundreds of PEPs that address different aspects of python. It is common for people to talk about PEP8, so you must know what that is, but you don't need to know any of the others. In this class, we will be enforcing that all of your code satisfies PEP8 using a python linter called
You should get output similar to
which tells you all of the linting errors your code has.
Fix your code so that NOTE: The CI tests first run the linter, then run the doctests. If the linter fails, then no doctests will run, and you will get a 0 on your assignment. You should infer from this that learning good pythonic programming style is a very important part of your grade in this class. Using CINow that you've made changes to your code, you should commit those changes and push them to github. Recall that this is done with the commands
As soon as you run the push command, github will automatically start running your code against 4 different versions of python (versions 3.6, 3.7, 3.8, and 3.9). Click the "actions" button at the top of your forked project webpage to see the results. You should see 4 green "builds" indicating that your program passed all test cases for each python version tested. If you see any red builds, then something went wrong, and you need to fix that problem before continuing. The CI badgeMost repos that use CI place a badge in their README file that indicatees the status of the most recent build. A green badge demonstrates that the repo passes all test cases, and therefore should instill confidence in potential users of the software that the software is high quality. This repo's
To fix this problem and get the correct badge,
you need to modify the Now view your forked repo in your web browser. You should see a green badge instead of a red badge if you made all of the changes correctly. NOTE: Whenever the grader sees a green badge on your homework submissions, it guarantees full credit on the assignment. SubmissionTo submit this assignment, you will past the URL to your github repo into sakai. The URL should be of the format
but with your github username instead of mine. IMPORTANT: It is not enough in this class to simply push your final code onto github. The grader will not know to grade your code unless you also submit it into sakai. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论