This repository has been archived by the owner on Dec 11, 2024. It is now read-only.
generated from agilepathway/gauge-jira
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not publish directories with no specs (#21)
* Do not publish directories with no specs This commit ensures that any directories without any specs in them are not published to Confluence. Prior to this commit these directories were being published, appearing in Confluence as pages without any content or subpages. This was distracting when trying to browse the published specs in Confluence. One example of this manifesting itself prior to this commit was if the Gauge [concept files][1] were put into their own concepts directory. As we only publish specs and not concepts to Confluence, having concepts in their own directory was leading to empty directory pages being published prior to this commit. The functional tests implementation code in this commit was lifted and shifted with only minor alterations from [the functional tests repo for core Gauge][2] (just like the existing functional test implementation code) - no point in reinventing the wheel. One other noteworthy thing is that the code to delete a page uses the low level [Go net http client][3], rather than the higher level [confluence-go-api client][4]. This is because there was a subtle bug with the confluence-go-api client (it was returning an error even after a successful delete, despite returning [the correct 204 status code][5]). It may be worth removing the confluence-go-api client altogether in a future pull request, as [minimising dependencies is generally a good thing][6]. [1]: https://docs.gauge.org/writing-specifications.html#concepts [2]: https://github.com/getgauge/gauge-tests [3]: https://pkg.go.dev/net/http [4]: https://github.com/Virtomize/confluence-go-api [5]: https://developer.atlassian.com/server/confluence/confluence-rest-api-examples/#delete-a-page [6]: https://endjin.com/blog/2018/09/whose-package-is-it-anyway-why-its-important-to-minimise-dependencies-in-your-solutions * Remove unused import * Exclude long urls in comments from go linting As per: golangci/golangci-lint#207 (comment) * Bump plugin minor version
- Loading branch information
Showing
12 changed files
with
208 additions
and
7 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
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Concepts are not published | ||
|
||
|
||
## Concepts are not published | ||
|
||
* Publish specs to Confluence: | ||
|
||
|heading |path |concept| | ||
|---------|-----|-------| | ||
|A spec |specs| | | ||
|A concept|specs|yes | | ||
|
||
* Published pages are: | ||
|
||
|title |parent | | ||
|----------|----------| | ||
|Space Home| | | ||
|specs |Space Home| | ||
|A spec |specs | | ||
|
||
## A directory that just contains concepts is not published | ||
|
||
* Publish specs to Confluence: | ||
|
||
|heading |path |concept| | ||
|-----------------------------|--------------|-------| | ||
|A spec in the specs dir |specs | | | ||
|A concept in the concepts dir|specs/concepts|yes | | ||
|
||
* Published pages are: | ||
|
||
|title |parent | | ||
|-----------------------|----------| | ||
|Space Home | | | ||
|specs |Space Home| | ||
|A spec in the specs dir|specs | |
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
33 changes: 33 additions & 0 deletions
33
...ional-tests/src/test/java/com/thoughtworks/gauge/test/common/builders/ConceptBuilder.java
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.thoughtworks.gauge.test.common.builders; | ||
|
||
import com.thoughtworks.gauge.Table; | ||
import com.thoughtworks.gauge.test.common.Concept; | ||
|
||
import static com.thoughtworks.gauge.test.common.GaugeProject.getCurrentProject; | ||
|
||
public class ConceptBuilder { | ||
private String conceptName; | ||
private Table steps; | ||
private String subDirPath; | ||
|
||
public ConceptBuilder withName(String conceptName) { | ||
this.conceptName = conceptName; | ||
return this; | ||
} | ||
|
||
public ConceptBuilder withSteps(Table steps) { | ||
this.steps = steps; | ||
return this; | ||
} | ||
|
||
public ConceptBuilder withSubDirPath(String subDirPath) { | ||
this.subDirPath = subDirPath; | ||
return this; | ||
} | ||
|
||
public Concept build() throws Exception { | ||
Concept concept = getCurrentProject().createConcept(subDirPath, conceptName, steps); | ||
getCurrentProject().addConcepts(concept); | ||
return concept; | ||
} | ||
} |
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
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
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
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