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

feat(back): #1337 remove test pull request builtin #1338

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -593,26 +593,6 @@ jobs:
- name: /tests/secretsForGpgFromEnv
run: nix-env -if . && m . /tests/secretsForGpgFromEnv

linux_testPullRequest_default:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@f095bcc56b7c2baf48f3ac70d6d6782f4f553222
- uses: docker://docker.io/nixos/nix@sha256:c3db4c484f6b1ee6c9bb8ca90307cfbeca8ef88156840911356a677eeaff4845
name: /testPullRequest/default
with:
args: sh -c "chown -R root:root /github/workspace && nix-env -if . && m . /testPullRequest/default"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
macos_testPullRequest_default:
runs-on: macos-latest
steps:
- uses: actions/checkout@f095bcc56b7c2baf48f3ac70d6d6782f4f553222
- uses: cachix/install-nix-action@6ed004b9ccb68dbc28e7c85bee15fa93dbd214ac
- name: /testPullRequest/default
run: nix-env -if . && m . /testPullRequest/default
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

linux_testTerraform_module:
runs-on: ubuntu-latest
steps:
Expand Down
85 changes: 0 additions & 85 deletions docs/src/api/builtins/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,91 +26,6 @@ Example:
m . /testLicense
```

## testPullRequest

Test a pull request
on any of the [supported platforms](https://danger.systems/js/guides/getting_started.html#setting-up-danger-to-run-on-your-ci)
using [Danger.js](https://danger.systems/js/guides/getting_started.html).

For more information
on how to use Danger.js,
please refer to its
[Getting started guide](https://danger.systems/js/guides/getting_started.html).

Types:

- testPullRequest:
- modules (`attrsOf moduleType`): Optional.
Danger configurations to use.
Defaults to `{ }`.
- moduleType (`submodule`):
- dangerfile (`path`):
Path to a Javascript or Typescript dangerfile.
- extraArgs (`listOf str`):
Extra arguments to pass
to the danger executable.
- setup (`listOf package`): Optional.
[Makes Environment](./environment.md)
or [Makes Secrets](./secrets.md)
to `source` (as in Bash's `source`)
before anything else.
Defaults to `[ ]`.

Example:

=== "makes.nix"

```nix
{
projectPath,
...
}:
{
testPullRequest = {
modules = {
github = {
dangerfile = projectPath "/dangerfiles/github.ts";
extraArgs = [
# Extra arguments for my dangerfile
"--config"
"strict"
];
};
gitlab = {
dangerfile = projectPath "/dangerfiles/gitlab.ts";
};
};
};
}
```

=== "dangerfiles/github.ts"

```typescript
import { argv } from "node:process";

import { danger, fail, warn } from "danger";

const nCommits = danger.git.commits.length;
const strict = argv[6] === "strict";

if (nCommits > 1) {
msg = `Only one commit per PR - Commits: ${nCommits}`
if (strict) {
fail(msg);
}
else {
warn(msg);
}
}
```

=== "Invocation"

```bash
$ m . /testPullRequest/github
```

## testPython

Test Python code
Expand Down
13 changes: 0 additions & 13 deletions makes.nix
Original file line number Diff line number Diff line change
Expand Up @@ -231,19 +231,6 @@
src = "/src/cli";
};
};
testPullRequest = {
modules = {
default = {
dangerfile = fetchUrl {
url =
"https://gitlab.com/fluidattacks/universe/-/raw/7012ee63b6ba5ffebfc82425deb4390cb1d4a1ca/common/test/mr/src/dangerfile.ts";
sha256 = "sha256-OegMHRXwgkRItyxW5SZfcQr21VRIINKhC5mlYa/Rphw=";
};
extraArgs =
[ "--config" (builtins.toJSON { tests = [ "onlyOneCommit" ]; }) ];
};
};
};
testTerraform = {
modules = {
module = {
Expand Down
1 change: 0 additions & 1 deletion src/args/agnostic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ let
taintTerraform = import ./taint-terraform/default.nix self;
testLicense = import ./test-license/default.nix self;
testTerraform = import ./test-terraform/default.nix self;
testPullRequest = import ./test-pull-request/default.nix self;
testPython = import ./test-python/default.nix self;
toDerivationName = __nixpkgs__.lib.strings.sanitizeDerivationName;
toBashArray = import ./to-bash-array/default.nix self;
Expand Down
18 changes: 0 additions & 18 deletions src/args/test-pull-request/default.nix

This file was deleted.

18 changes: 0 additions & 18 deletions src/args/test-pull-request/entrypoint.sh

This file was deleted.

Loading
Loading