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

run-local.sh: Various cleanups, prepare for job-runner #589

Merged
merged 4 commits into from
Mar 7, 2024

Conversation

martinpitt
Copy link
Member

Broken out of #586 -- these parts apply to the current infra. I re-triggered cockpit-project/bots#6017 and it is green now 💚 .

With job-runner, the repo will be cloned in a pristine environment. git
will be rather unhappy to try and clone the "123abc" mock SHA.
curl an existing URL, to avoid printing the 404 page on success --
that's confusing when looking at the log.
This prepares us for testing job-runner, where the mock git command
needs to be installed into the job container as well.

Also write the log into a test attachment instead of /work. That way, we
can access it regardless of where it ran.
When we'll move to job-runner, then `image-create` will not run in the
cockpituous-tasks container any more. So instead of assuming that the
image is already in /cache/images, download it from S3 instead.
Copy link
Member

@allisonkarlitskaya allisonkarlitskaya left a comment

Choose a reason for hiding this comment

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

Thanks 💚

export GITHUB_API=http://127.0.0.7:8443
until curl --silent \$GITHUB_API; do sleep 0.1; done
export GITHUB_API=$GHAPI_URL_POD
until curl --silent --fail \$GITHUB_API/repos/cockpit-project/bots; do sleep 0.1; done
Copy link
Member

Choose a reason for hiding this comment

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

I almost commented here that hardcoding this was bad, for example, but that's obviously non-sense in this case.

Sometimes I think it would be better to have named this repository something different. I always get confused about things on the real GitHub (which should allow for generalization based on which fork is running the tests) vs. our mocked-up stuff.

This is officially a drive-by.

echo "$@" >> "${TEST_ATTACHMENTS}/git-push.log"
exit 0
fi
exec /usr/bin/git "$@"
Copy link
Member

Choose a reason for hiding this comment

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

I'm not crazy about this, but it's probably the best option for the time being...

In a certain sense, this is mocking in its purest form...

@@ -46,7 +46,7 @@ jobs:
- name: Check which containers changed
id: containers_changed
run: |
tasks=$(git diff --name-only origin/main..HEAD -- tasks/ | grep -Ev 'run-local.sh|openssl.cnf|README|mock-github|.yaml' || true)
tasks=$(git diff --name-only origin/main..HEAD -- tasks/ | grep -Ev 'run-local.sh|openssl.cnf|README|mock-|.yaml' || true)
Copy link
Member

Choose a reason for hiding this comment

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

This is starting to beg for a separate tasks/container/ directory...

@allisonkarlitskaya allisonkarlitskaya merged commit accb1fd into main Mar 7, 2024
3 checks passed
@allisonkarlitskaya allisonkarlitskaya deleted the test-cleanups branch March 7, 2024 08:10
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

Successfully merging this pull request may close these issues.

2 participants