Integration and Verification Techniques (VIMIAC04)
Note: Please treat these exercises also as professional work. For example, instead of "asdfg" use more meaningful commit messages like "Add acceleration feature" or "Fix #5" (you can find detailed advice in the How to Write a Git Commit Message and the Git Style Guide posts).
In most of the exercises we use command line tools instead of IDEs, since only those can be used in a CI environment. Moreover, you can learn more this way for beginner exercises.
You will need the following software to complete the lab (these are available on the virtual machine template in the BME cloud, but you can use your own machine too):
Important: If you use your own machine, then check
that Java JDK is configured correctly: use JDK and not JRE, set
PATH
and JAVA_HOME
(see here in
details).
java -version
javac -version
Important: Since 2021 you cannot authenticate with passwords to GitHub from the command line. You should create first a personal access token (PAT), and use that from the git commands.
In these exercises everyone will make the same extensions and fixes on the same example open source project. Therefore, instead of the traditional method (creating a fork), everyone will make their own repository with the same initial content as a basis for further work.
ivt-lab
under your own GitHub user and initialize it
(Initialize this repository with a README). You will use this
repository for the rest of the exercises.git clone
command).
git init
ivt-lab
folder
(cd
)!ivt-lab-master
folder into your local repository
(the folder itself is not needed!).git status
).git add
).git commit
).
git commit
might complain at its first execution
that the user name and the e-mail is not configured. This can be done
with the commands git config user.email "you@example.com"
and git config user.name "Your Name"
.git push
).The purpose of this subtask is to build and test the project in your own repository using GitHub Actions.
maven.yml
file that is created based on the workflow's
template.yml
(YAML) file whether it uses JDK 11 for
building the project. You can look up the syntax in the referenced
page.GitHub Actions should report an error in a unit test. This error is caused by a function that is not completely implemented (the ALL firing mode of the torpedo). The purpose of this subtask is to fix this error in a GitHub Flow.
[web/local] Examine the output of the CI build and the source code to see the cause of the failing test.
[web] Define the new function to be implemented precisely using an issue on the web interface for your GitHub repository.
[web] Create a new branch for development.
[local] Download the changes from the remote
repository (git pull
) and switch to the previously created
branch (git checkout
).
[local] Implement the feature and test it
locally (mvn test
).
[local] Commit and push the changes to the
remote repository (git commit
, git push
).
Important: Even if you implemented the missing
feature, and the test runs on your machine, the CI pipeline will fail.
If the error is: "Resource not accessible by integration"
,
follow this solution.
[web] Create a pull request on the web interface of your repository for the you changes made previously. The text of the pull request should include the phrase "Fix #1", which indicates that this will fix issue number 1.
[web] Examine the pull request and if it looks fine, accept it, merge it into the master branch and delete the development branch. (We will see the reviewing possibilities provided by the pull requests in the next lesson.)
[local] Download the changes from the remote
repository and inspect them using the command
git log
.
Further information:
branch-A
and branch-B
) locally using the
command line.branch-A
, edit a
line of a file and commit the change.branch-B
, edit the
same line of the same file and commit the change.master
branch
and merge the branches one after each other. Check the result of
merging, resolve the conflict and commit the changes that happened
during conflict resolution.Commit every change, push it to the remote repository and check that the CI build is successful.
Do not delete your remote (GitHub) repository as it will be used in the subsequent lessons.