generated from actions/typescript-action
-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from mikepenz/feature/initial_test_version
First version being able to import junit xray results
- Loading branch information
Showing
15 changed files
with
11,768 additions
and
510 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,61 @@ | ||
name: 'build-test' | ||
on: # rebuild any PRs and main branch changes | ||
pull_request: | ||
name: 'CI' | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- 'releases/*' | ||
tags: | ||
- '*' | ||
pull_request: | ||
|
||
jobs: | ||
build: # make sure build/ci work properly | ||
build: | ||
if: github.event_name == 'pull_request' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: | | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Install NPM | ||
run: | | ||
npm install | ||
- run: | | ||
- name: Run NPM | ||
run: | | ||
npm run all | ||
test: # make sure the action works on a clean machine without building | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
test: | ||
if: github.event_name == 'pull_request' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
# - name: "Run imports" | ||
# id: minimal_release | ||
# uses: ./ | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
release: | ||
if: startsWith(github.ref, 'refs/tags/') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: ./ | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: "Build Changelog" | ||
id: github_release | ||
uses: mikepenz/release-changelog-builder-action@main | ||
with: | ||
milliseconds: 1000 | ||
configuration: "configs/configuration_repo.json" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Create Release | ||
uses: actions/create-release@v1 | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.ref }} | ||
body: ${{steps.github_release.outputs.changelog}} | ||
prerelease: ${{ contains(github.ref, '-rc') || contains(github.ref, '-b') || contains(github.ref, '-a') }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,25 @@ | ||
import {wait} from '../src/wait' | ||
import * as process from 'process' | ||
import * as cp from 'child_process' | ||
import * as path from 'path' | ||
import {Processor} from '../src/processor' | ||
|
||
test('throws invalid number', async () => { | ||
const input = parseInt('foo', 10) | ||
await expect(wait(input)).rejects.toThrow('milliseconds not a number') | ||
}) | ||
|
||
test('wait 500 ms', async () => { | ||
const start = new Date() | ||
await wait(500) | ||
const end = new Date() | ||
var delta = Math.abs(end.getTime() - start.getTime()) | ||
expect(delta).toBeGreaterThan(450) | ||
}) | ||
test('import test results', async () => { | ||
jest.setTimeout(180000) | ||
|
||
// shows how the runner will run a javascript action with env / stdout protocol | ||
test('test runs', () => { | ||
process.env['INPUT_MILLISECONDS'] = '500' | ||
const ip = path.join(__dirname, '..', 'lib', 'main.js') | ||
const options: cp.ExecSyncOptions = { | ||
env: process.env | ||
} | ||
console.log(cp.execSync(`node ${ip}`, options).toString()) | ||
/* | ||
await new Processor( | ||
{ | ||
username: "x", | ||
password: "x" | ||
}, | ||
{ | ||
testPaths: "marathon_tests/*.xml", | ||
testExecKey: "TA-1", | ||
projectKey: "TA", | ||
testPlanKey: "", | ||
testEnvironments: "", | ||
revision: "", | ||
fixVersion: "", | ||
failOnImportError: false, | ||
continueOnImportError: true | ||
} | ||
).process() | ||
*/ | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.