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

Running ember test fails #2

Closed
balinterdi opened this issue May 13, 2019 · 11 comments
Closed

Running ember test fails #2

balinterdi opened this issue May 13, 2019 · 11 comments
Labels
bug Something isn't working

Comments

@balinterdi
Copy link

Hey Alex,

Thank you for putting this together. I tried it on one of my projects and got a failing build:

sh: 1: ./node_modules/.bin/ember: not found

### FAILED Run ember tests 11:34:08Z (1m17.932s)

Locally the ember executable is there, maybe not in the Docker build?

@alexlafroscia
Copy link
Owner

Interesting! Can you post your main.workflow file?

One thing to note: I currently do not support any kind of configuration around where to find the Ember app just yet; we make a hard assumption that the root of Git repo is the Ember application (or addon).

I have this step up for ember-steps and it seems to be working alright over there!

https://github.com/alexlafroscia/ember-steps

I don't know if you can see this screen, but I have the action/workflow going here

https://github.com/alexlafroscia/ember-steps/actions

@alexlafroscia alexlafroscia added the bug Something isn't working label May 13, 2019
@balinterdi
Copy link
Author

Thanks for the quick response.

I have this in .github/main.workflow:

workflow "Test and deploy" {
  on = "push"
  resolves = ["Run ember tests"]
}

action "Run ember tests" {
  uses = "alexlafroscia/actions-ember-testing@master"
}

@alexlafroscia
Copy link
Owner

Ah! Looks like you're missing an action to actually install your dependencies.

The idea with Actions is to keep them small and focused. To that end, this action intentionally does not perform the initial dependency installation itself; it assumes a previous step provides an environment with the dependencies installed.

If you check out the screenshot in the README, you can see that there's a separate initial action that does the dependency install.

Assuming you are using yarn, your workflow should look something like this instead:

workflow "Test and deploy" {
  on = "push"
  resolves = ["Run ember tests"]
}

action "Install dependencies" {
  uses = "nuxt/actions-yarn@node-10"
  args = "install"
}

action "Run ember tests" {
  uses = "alexlafroscia/actions-ember-testing@master"
  needs = ["Install Dependencies"]
}

If you are using npm, you would replace the nuxt/actions-yarn with some action that uses npm to install your dependencies. Likely the official npm action would work for you with something like

action "Install dependencies" {
  uses = "actions/npm@master"
  args = "install"
}

I will update the README to make this more clear.

@alexlafroscia
Copy link
Owner

Just to follow up, I added a more basic configuration example in the README and am working on flexing out more information in the Wiki.

You can find a better explanation of how to set things up here!

https://github.com/alexlafroscia/actions-ember-testing/wiki

@balinterdi
Copy link
Author

Thanks, Alex, I modified it as per your instructions and that will probably work (I'll tell if it doesn't).

I'm very new to Github Actions but what you say (that they are atomic, like build steps) makes perfect sense, and already loving the idea.

@alexlafroscia
Copy link
Owner

Great! If I can help any more, please let me know.

@balinterdi
Copy link
Author

I'd set up the flow as you describe in the wiki but it still doesn't work, giving me another error in the "Install dependencies" step:

Successfully built 47c8ace7d756
Successfully tagged gcr.io/gct-12-z1l1kaa043ni7sykzr3l2mz/4510d5fb12c435cfb1d8f34d0001f3347fc6b3c1860acfdf18b186f5f208f831/8a5edab282632443219e051e4ade2d1d5bbc671c781051bf1437897cbdfea0f1:09c79b58802ff70a700a8d4ff24f32a7f4cf74916138b9b42a535087f906793a
Already have image (with digest): gcr.io/github-actions-images/action-runner:latest
yarn install v1.13.0
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
error Couldn't find the binary git
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

It seems like git needs to be installed before installing the dependencies?

@balinterdi
Copy link
Author

Hmm, or maybe it's rather this:
yarnpkg/yarn#2083

@alexlafroscia
Copy link
Owner

That's interesting... sorry it's not working for you!

Do you have any dependencies with a git: protocol or dependencies installed directly from GitHub? Or are they all "normal" dependencies from an NPM registry?

I haven't run into that error before, either on a local machine or with this action.

@balinterdi
Copy link
Author

You're spot on, again :)

I do have a couple of github: dependencies since the app I'm using it on is an Octane app:

// package.json
  "devDependencies": {
    "ember-cli": "github:ember-cli/ember-cli#807f56e2e434f716757de02fd1f2c3251dadaf6f",
    "ember-composable-helpers": "DockYard/ember-composable-helpers",
    "ember-data": "github:emberjs/data#1df833396855d956b817540923dd89338463fec2",
    "ember-source": "https://s3.amazonaws.com/builds.emberjs.com/canary/shas/888d6b1ec8240aacb7e1ccbefd42002d22d40068.tgz",
  }

(The ember-composable-helpers one has nothing to do with Octane. I think everybody is using the "githhub" version as a release hasn't been cut for quite a while. And now that I'm writing this I see they've now released a new version.)

@alexlafroscia
Copy link
Owner

I see. Interesting...

This action doesn't actually do any of the dependency installation, so I'm not sure how much I can help. I'd suggest making an issue over at the nuxt/actions-yarn repo though (assuming you're using Yarn; otherwise on the NPM action's repo) since those are the bits that actually do the dependency installation!

If there's anything else I can help with, please let me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants