Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Add automatic tests to the project #142

Merged
merged 6 commits into from
Jan 29, 2020

Conversation

krufab
Copy link

@krufab krufab commented Jan 17, 2020

Added tests to the project, as per issue jenkinsci/docker-agent#671 and issue 100 in docker-slave

Closes jenkinsci/docker-agent#671

Signed-off-by: Fabio Kruger <[email protected]>
@krufab krufab requested a review from a team as a code owner January 17, 2020 00:34
@oleg-nenashev
Copy link
Member

Thanks! We will need to resubmit the PR to check whether the Jenkinsfile really works on the CI instance, but the code looks good overall

Makefile Outdated Show resolved Hide resolved
tests/tests.bats Outdated Show resolved Hide resolved
@krufab krufab requested a review from slide January 21, 2020 21:24
@krufab
Copy link
Author

krufab commented Jan 21, 2020

Please note that the tests are not being executed as the modified Jenkinsfile isn't processed. Besides, I guess bats won't be available on the machine..

Jenkinsfile Outdated Show resolved Hide resolved
@slide
Copy link
Member

slide commented Jan 21, 2020

I created #143 to test the build

@krufab
Copy link
Author

krufab commented Jan 27, 2020

Is it ok this PR or is there anything to change?

Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

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

Looks great, thanks!

@oleg-nenashev
Copy link
Member

oleg-nenashev commented Jan 29, 2020

Ignoring the CI issues, because Windows infra needs a fix

@oleg-nenashev oleg-nenashev merged commit c9c6aae into jenkinsci:master Jan 29, 2020
@oleg-nenashev oleg-nenashev changed the title Added tests to the project Add automatic tests to the project Jan 29, 2020
@oleg-nenashev
Copy link
Member

@slide @krufab Looks like CI fails after all

[2020-01-29T16:39:16.098Z] + make test

[2020-01-29T16:39:16.098Z] Cloning into 'bats-core'...

[2020-01-29T16:39:16.356Z] HEAD is now at c706d14 Bats 1.1.0

[2020-01-29T16:39:20.528Z] 1..4

[2020-01-29T16:39:20.784Z] ok 1 [alpine] build image

[2020-01-29T16:39:24.964Z] ok 2 [alpine] image has installed jenkins-agent in PATH

[2020-01-29T16:39:39.824Z] ok 3 [alpine] image starts jenkins-agent correctly

[2020-01-29T16:39:58.494Z] ok 4 [alpine] use build args correctly

[2020-01-29T16:39:58.494Z] 1..4

[2020-01-29T16:39:58.494Z] ok 1 [debian] build image

[2020-01-29T16:40:01.027Z] ok 2 [debian] image has installed jenkins-agent in PATH

[2020-01-29T16:40:15.882Z] not ok 3 [debian] image starts jenkins-agent correctly

[2020-01-29T16:40:15.882Z] # (in test file tests/tests.bats, line 59)

[2020-01-29T16:40:15.882Z] #   `[ $'GET /tcpSlaveAgentListener/ HTTP/1.1\r' = "${lines[0]}" ]' failed with status 124

[2020-01-29T16:40:15.882Z] # 1e24fe7e97e28d951d3da2c5e844409ac5330aa373f65d9b7aecc6d2b0c96ef9

[2020-01-29T16:40:15.882Z] # 9242597faa79c429ab5d8ea96714926472644b887b3add40a799a2984432cd68

[2020-01-29T16:40:15.882Z] # /tmp/bats.25649.src: line 59: lines[0]: unbound variable

[2020-01-29T16:41:02.522Z] ok 4 [debian] use build args correctly

[2020-01-29T16:41:02.522Z] Makefile:33: recipe for target 'test-debian' failed

[2020-01-29T16:41:02.522Z] make: *** [test-debian] Error 1

@krufab
Copy link
Author

krufab commented Jan 29, 2020

I'll check it in few hours

@krufab
Copy link
Author

krufab commented Jan 29, 2020

The failure is probably due to the fact that it took too much time to start the jenkins jnlp agent image. Test 3 completes successfully for alpine and it's the same code for the debian one.
The test firstly spins off a docker jnlp agent in a detached mode, then starts a netcat container listening on port 5000 which waits for 10s to have the agent connect. After 10s the netcat container shuts down and returns the header read (if any). If the jnlp container doesn't boot it that time, the test fails.

To fix it, we can extend the timeout to i.e. 30s. I can create a branch to patch master or I can resolve the issue in the next full change branch that I will submit soon.

@oleg-nenashev
Copy link
Member

Small change for this issue would be great

@krufab
Copy link
Author

krufab commented Jan 29, 2020

Done in #148

lemeurherve pushed a commit to lemeurherve/docker-agent that referenced this pull request Nov 28, 2023
…ufab/add_test_and_uniform_code

Added tests to the project
lemeurherve pushed a commit to lemeurherve/docker-agent that referenced this pull request Nov 28, 2023
…ufab/add_test_and_uniform_code

Added tests to the project
lemeurherve pushed a commit to lemeurherve/docker-agent that referenced this pull request Nov 28, 2023
…ufab/add_test_and_uniform_code

Added tests to the project
lemeurherve pushed a commit to lemeurherve/docker-agent that referenced this pull request Nov 28, 2023
…ufab/add_test_and_uniform_code

Added tests to the project
lemeurherve pushed a commit to lemeurherve/docker-agent that referenced this pull request Nov 28, 2023
…ufab/add_test_and_uniform_code

Added tests to the project
lemeurherve pushed a commit to lemeurherve/docker-agent that referenced this pull request Nov 28, 2023
…ufab/add_test_and_uniform_code

Added tests to the project
lemeurherve pushed a commit to lemeurherve/docker-agent that referenced this pull request Nov 28, 2023
…ufab/add_test_and_uniform_code

Added tests to the project
lemeurherve pushed a commit to lemeurherve/docker-agent that referenced this pull request Jan 12, 2024
…_test_and_uniform_code

Added tests to the project
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add tests to the project
3 participants