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 the CI test locally #317

Merged
merged 3 commits into from Aug 3, 2017
Merged

Run the CI test locally #317

merged 3 commits into from Aug 3, 2017

Conversation

rthallisey
Copy link
Contributor

Give the developer the ability to run the CI test locally. Run the
test by: make ci. It will provision mediawiki and postgresql
apbs then bind them.

Changes proposed in this pull request

  • Ability to run make run to test provision & bind

@rthallisey
Copy link
Contributor Author

Copy link
Contributor

@jmrodri jmrodri left a comment

Choose a reason for hiding this comment

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

Some questions and suggestions.

- sleep 30
- oc create -f ./scripts/broker-ci/bind-mediawiki-postgresql.yaml || export ERROR=true
- sleep 5
- oc delete pods $(oc get pods -n default | grep mediawiki | awk $'{ print $1 }') -n default || export ERROR=true
- oc delete pods $(oc get pods -o name -l app=mediawiki123 -n default | head -1 | cut -f 2 -d '/') -n default
- sleep 20
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to move most of this to its own script instead of cluttering .travis.yml?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. After make ci merges, travis is going to use make ci for testing. I'm going to follow up with that and some changes to make sure the scripts log really well and return good error messages.

- sleep 30
- oc create -f ./scripts/broker-ci/bind-mediawiki-postgresql.yaml || export ERROR=true
- sleep 5
- oc delete pods $(oc get pods -n default | grep mediawiki | awk $'{ print $1 }') -n default || export ERROR=true
- oc delete pods $(oc get pods -o name -l app=mediawiki123 -n default | head -1 | cut -f 2 -d '/') -n default
Copy link
Contributor

Choose a reason for hiding this comment

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

good use of head and cut. I always forget about them.

ci:
./scripts/broker-ci/local-ci.sh

.PHONY: vendor build run prepare-build-image build-image release-image release push clean deploy test ci cleanup-ci
Copy link
Contributor

Choose a reason for hiding this comment

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

like the new targets. Do we want to add cleanup-ci to really-clean? Just curious maybe not needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure.

- Curl the Mediawiki endpoint to check for success
* Requires:
- Cluster
- Service Catalog
Copy link
Contributor

Choose a reason for hiding this comment

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

Good addition.

oc delete instance postgresql mediawiki -n default
oc delete dc postgresql mediawiki123 -n default
./scripts/broker-ci/wait-for-resource.sh delete pod postgresql
./scripts/broker-ci/wait-for-resource.sh delete pod mediawiki
Copy link
Contributor

Choose a reason for hiding this comment

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

+1 looks good to me

echo "Running: curl ${ROUTE}| grep \"div class\" | cut -f 2 -d \"'\""
if [ "${BIND_CHECK}" = "error" ]; then
echo "MAKE CI FAILED"
elif [ "${BIND_CHECK}" = "" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it really = and not ==?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Either works.

string1 == string2
string1 = string2
       True if the strings are equal.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks didn't know that.

fi
}

provision
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer a comment above provision:

#
# MAIN
#

something like that just to make it easier to remember that this is where we start.

echo "Waiting for ${RESOURCE_NAME} ${RESOURCE} to be created"
sleep 1
done
elif [ "${ACTION}" = "delete" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

+1 to rename, same question about = vs ==.

Copy link
Contributor

@shawn-hurley shawn-hurley left a comment

Choose a reason for hiding this comment

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

Was able to test ACK

Ryan Hallisey added 3 commits August 3, 2017 08:40
Give the developer the ability to run the CI test locally. Run the
test by: ```make ci```. It will provision mediawiki and postgresql
apbs then bind them.
@jmrodri jmrodri merged commit c9d7481 into openshift:master Aug 3, 2017
@rthallisey rthallisey deleted the make-ci branch August 3, 2017 13:50
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.

None yet

3 participants