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
test: check that /examples has no changes #199
test: check that /examples has no changes #199
Conversation
.travis.yml
Outdated
@@ -40,3 +40,5 @@ script: | |||
- cargo install --debug -f --path . | |||
- cd ../ | |||
- ./smoke-test.sh | |||
# Check that /examples has no changes | |||
- if [ -z "$(git status --porcelain)" ]; then echo "/examples is out of date. Please run `./smoke-test.sh` locally and commit the changes"; exit 1; fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this need to be '! -z`?
- if [ -z "$(git status --porcelain)" ]; then echo "/examples is out of date. Please run `./smoke-test.sh` locally and commit the changes"; exit 1; fi | |
- if [ ! -z "$(git status --porcelain)" ]; then echo "/examples is out of date. Please run `./smoke-test.sh` locally and commit the changes"; exit 1; fi |
@samschlegel I apologize for this but because of #202, master will generate some diffs in the examples. Could I get you to add the following diff to this PR? diff --git a/impl/src/templates/remote_crates.bzl.template b/impl/src/templates/remote_crates.bzl.template
index ed0d9e8..df88ed5 100644
--- a/impl/src/templates/remote_crates.bzl.template
+++ b/impl/src/templates/remote_crates.bzl.template
@@ -17,8 +17,8 @@ def _new_git_repository(name, **kwargs):
def {{workspace.gen_workspace_prefix}}_fetch_remote_crates():
{%- if crates %}
- {% for crate in crates %}
- {%- if crate.source_details.git_data %}
+{% for crate in crates %}
+ {%- if crate.source_details.git_data %}
_new_git_repository(
name = "{{workspace.gen_workspace_prefix}}__{{crate.pkg_name | replace(from="-", to="_")}}__{{crate.pkg_version | slugify | replace(from="-", to="_")}}",
remote = "{{crate.source_details.git_data.remote}}",
@@ -27,7 +27,7 @@ def {{workspace.gen_workspace_prefix}}_fetch_remote_crates():
init_submodules = True,
{%- include "templates/partials/remote_crates_patch.template" %}
)
- {%- else %}
+ {%- else %}
_new_http_archive(
name = "{{workspace.gen_workspace_prefix}}__{{crate.pkg_name | replace(from="-", to="_")}}__{{crate.pkg_version | slugify | replace(from="-", to="_")}}",
url = "https://crates-io.s3-us-west-1.amazonaws.com/crates/{{crate.pkg_name}}/{{crate.pkg_name}}-{{crate.pkg_version}}.crate",
@@ -39,8 +39,8 @@ def {{workspace.gen_workspace_prefix}}_fetch_remote_crates():
{%- include "templates/partials/remote_crates_patch.template" %}
build_file = Label("{{workspace.workspace_path}}/remote:{{crate.pkg_name}}-{{crate.pkg_version}}.{{workspace.output_buildfile_suffix}}"),
)
- {%- endif %}
- {% endfor %}
+ {%- endif %}
+{% endfor %}
{%- else %}
pass
{% endif %} I can create my own PR for this if you'd rather not. I just felt like it was a small enough change that it'd be worth making here instead of committing the diffs in the examples directory (which is only a whitespace difference) |
I'm not really sure what happened with the test output here... it looks like it got mixed in with a bunch of output that I'm also not sure where came from since it happened after the smoke test exited 🤔 |
edit: I misread, I see what you're saying now. But I still think your check will fail if you don't and do something about my comment above |
I think it's because it was outputting to stdout and travis probably does something weird with stdout output at the end. Rebasing anyways, but don't think it's related |
@samschlegel Yeah, sounds likely. I have very little experience with Travis-CI though so I have to do some more digging to really help out. Hopefully your change fixes it though! 😄 |
Going to add a |
Apparently my find iterates different than @UebelAndre's 😅
Yeah my intention is to make sure this fails correctly, then fix things and make sure it works there too. I'd like to be able to test this...but who CI's the CI‽ |
🤦 I'm using backticks in a double-quoted string lmaoooooo |
andddd, that rebase did something WEIRD |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
384fa41
to
c79095e
Compare
@samschlegel Looks good but I just wanted to get clarity on this comment. Would you mind making that change as well? No worries if not, I'm just trying to cover up my shame 😅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just have a minor comment, there seems to be an unwanted edit in this PR.
This reverts commit 6ea6543.
Thanks! |
…r defects. (#207) This is a followup on comments made in #199 The `crates.bzl` file generated in the event that no crates are defined looks like the following ```python """ @generated cargo-raze crate workspace functions DO NOT EDIT! Replaced on runs of cargo-raze """ load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository") # buildifier: disable=load load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # buildifier: disable=load load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") # buildifier: disable=load def raze_fetch_remote_crates(): """No crates were detected in the source Cargo.toml. This is a no-op""" pass ```
Fixes #198
This will fail until something like #191 gets merged to update the examples