Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Makeing it easier to test from a developer's laptop

Đang mở
#71 1 bình luận 1 reaction 1 người được giao Xem trên GitHub

@nmaludy đang làm issue này rồi.

Từ ngày 31/7/2020.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

enhancement
Summary

We maintain our own semi-fork of this repo at https://github.com/EncoreTechnologies/ci-stackstorm
The reason for this is because this repo isn't great at running from a developers laptop. Specifically it creates directories the ~/ci and ~/virtualenv, along with several other problems (outlined below).

Goals
  • I would like to be able to utilize this repo for testing, at some level, so that our code always is testing against the upstream configs
  • I would like this repo to be able to be utilized on a developers laptop
  • I would like this repo to easily be able to test against multiple packs on the same machine
  • I would like this repo to have support for both python2 and python3
  • I would like this repo to have support for both Ubuntu and CentOS
Current problems/challenges/etc

Below is a list of things we had to change from these Makefiles and scripts to get the testing to work on a developers laptop:

CI repo

https://github.com/StackStorm-Exchange/ci/blob/master/.circleci/config.yml explicitly sets up the CI repo in ~/ci and and virtualenv in ~/virtualenv. This leads to potential issues when multiple
packs are tested on a single system, specifically around the ~/virtualenv. We've had cases where a user forgot to add in a dependency into requirements.txt and because the virtualenv was already setup in ~/virtualenv from another packs' run, we never noticed the problem until we had deployed the pack to our staging environment.

Proposed Changes
  • Setup a Makefile that is designed to be placed in a Pack's root directory. This Makefile clones the ci repo and then executes the tests. This Makefile is designed to be kicked off by a user and can coordinate all steps needed to happen in order to run tests. Basically, merge functionality from .circleci/config.yml, .circle/dependencies, .circle/test together into the Makefile.
  • Clone the CI repo into ./ci inside the pack's directory instead of ~/ci. Cloning locally means each pack has their own copy when testing against multiple packs on a single machine (preventing file corruption issues).
Dependencies

The dependency script that is run by this CI repo has a couple problems:

  • It is not idempotent, so when a developer wants to run their tests a 2nd time, the dependency script errors, specifically around the git clone methods.
  • The script hard codes the CI_DIR to be /home/circleci/ci
  • The script expects a Debian instance and calls apt-get
  • The script creates a ~/virtualenv
Proposed Changes
  • Put these dependency resolution steps into a Makefile and have idempotent checks like:
	if [ ! -d "$(ST2_REPO_PATH)" ]; then \
		git clone https://github.com/StackStorm/st2.git --depth 1 --single-branch --branch $(ST2_REPO_BRANCH) $(ST2_REPO_PATH); \
	else \
		cd "$(ST2_REPO_PATH)"; \
		git pull; \
	fi;
  • Put the dependencies into ./ci inside the pack's directory instead of ~/ci or /home/circleci/ci
  • Put virtualenv into ./ci/virtualenv inside the pack's directory instead of ~/virtualenv
  • Don't run any apt-get or yum commands.
packs-resource-register requires MongoDB

Currently the packs-resource-register test requires that a MongoDB instance be running. Unless the user has a docker up and a MongoDB container running, this test is hard to run.

Proposed Changes
  • See if we can modify the test to not require MongoDB at all and just validate against known schemas?
Ngôn ngữ chính
Shell
Star
5
Fork
18
Merge trung bình
1 phút
Pull request đã merge (30 ngày)
8

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của StackStorm-Exchange/ci

Tất cả issue của StackStorm-Exchange/ci

Issue tương tự

Thêm issue về Shell/Bash

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.