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

Write Test Case For Azure cli Action #48

Merged
merged 7 commits into from
Aug 23, 2021
Merged

Conversation

PankajGovindRao
Copy link
Contributor

Test Case For Azure cli Action

@ghost
Copy link

ghost commented Aug 9, 2021

CLA assistant check
All CLA requirements met.

src/main.ts Outdated
@@ -21,15 +22,18 @@ const run = async () => {
}

let inlineScript: string = core.getInput('inlineScript', { required: true });
let azcliversion: string = core.getInput('azcliversion', { required: true }).trim().toLowerCase();

let azcliversion: string = core.getInput('azcliversion', { required: true });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add .trim().toLowerCase() back

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added .trim().toLowerCase()

src/main.ts Outdated
if (!(await checkIfValidCLIVersion(azcliversion))) {
console.log("INVALID VERSION")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this console.log

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

src/main.ts Outdated
core.setFailed('Please enter a valid azure cli version. \nSee available versions: https://github.com/Azure/azure-cli/releases.');
throw new Error('Please enter a valid azure cli version. \nSee available versions: https://github.com/Azure/azure-cli/releases.')
return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove return

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

src/main.ts Outdated
return;
}

if (!inlineScript.trim()) {
core.setFailed('Please enter a valid script.');
throw new Error('Please enter a valid script.')
return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove return

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -0,0 +1,47 @@
name: ci-workflow
on:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace on with this -

on:
  push:
  schedule:
    - cron: '0 */3 * * *'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

INPUT_INLINESCRIPT: " "
EXPECTED_TO: fail
run: ts-node test/main.test.ts

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add post status action at the end

 - name: Post to slack on failure
        if: failure()
        uses: 8398a7/[email protected]
        with:
            status: ${{ job.status }}
            fields: repo,message,author,action,ref,workflow
        env:
            SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@github-actions
Copy link

This PR is idle because it has been open for 14 days with no activity.

@github-actions github-actions bot added the idle Inactive for 14 days label Aug 21, 2021
@t-dedah t-dedah merged commit dbebf94 into Azure:master Aug 23, 2021
t-dedah added a commit that referenced this pull request Nov 10, 2021
* Updated Readme for Azure CLI actions  (#29)

* Update README.md

* Update README.md

Co-authored-by: Usha N <[email protected]>

* Add changes

* Added add-label workflow (#41)

* Added add-label workflow

* Updated default label worlkflow for health dashboard

* Reduced time

* Added issue template for health dashboard (#42)

* Added issue template for health dashboard

* Added assignees

* Add 'getting help' section to point customers to Azure CLI Repo for help (#50)

Signed-off-by: James Casey <[email protected]>

* Write Test Case For Azure cli Action (#48)

* Create main.test.ts

* Create ci-workflow.yml

* Update main.ts

* Update ci-workflow.yml

* Update main.ts

* Update ci-workflow.yml

* Update ci-workflow.yml

* Resolved multiple README issues (#51)

* Resolved multiple issues

* revert

* Changed default for azcliversion. (#57)

* Added restrictLatestToAgent

* typo

* required set to false

* Changed default to agent az cli version

* deleted lib files

* Resolved comments

* Add changes

* Update package.json

* Update package-lock.json

* Upgrade version (#59)

* Revert "Update package-lock.json"

This reverts commit 5633362.

* Revert "Update package.json"

This reverts commit f4b36bb.

* Upgrade version in packkage.json

Co-authored-by: Zainudeen V K <[email protected]>
Co-authored-by: Usha N <[email protected]>
Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: James Casey <[email protected]>
Co-authored-by: PankajGovindRao <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idle Inactive for 14 days
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants